File tree Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,20 @@ public static function init(): void {
10
10
}
11
11
12
12
public static function register_blocks (): void {
13
- $ data_source_configs = DataSourceCrud::get_configs_by_service ( REMOTE_DATA_BLOCKS_AIRTABLE_SERVICE );
13
+ $ data_source_configs = DataSourceCrud::get_configs_by_service (
14
+ REMOTE_DATA_BLOCKS_AIRTABLE_SERVICE
15
+ );
14
16
15
17
foreach ( $ data_source_configs as $ config ) {
16
18
$ data_source = AirtableDataSource::from_array ( $ config );
17
19
self ::register_block_for_airtable_data_source ( $ data_source );
18
20
}
19
21
}
20
22
21
- public static function register_block_for_airtable_data_source ( AirtableDataSource $ data_source , array $ block_overrides = [] ): void {
23
+ public static function register_block_for_airtable_data_source (
24
+ AirtableDataSource $ data_source ,
25
+ array $ block_overrides = []
26
+ ): void {
22
27
register_remote_data_block (
23
28
array_merge (
24
29
[
@@ -38,7 +43,10 @@ public static function register_block_for_airtable_data_source( AirtableDataSour
38
43
);
39
44
}
40
45
41
- public static function register_loop_block_for_airtable_data_source ( AirtableDataSource $ data_source , array $ block_overrides = [] ): void {
46
+ public static function register_loop_block_for_airtable_data_source (
47
+ AirtableDataSource $ data_source ,
48
+ array $ block_overrides = []
49
+ ): void {
42
50
register_remote_data_block (
43
51
array_merge (
44
52
[
Original file line number Diff line number Diff line change @@ -52,7 +52,10 @@ protected static function get_service_config_schema(): array {
52
52
protected static function map_service_config ( array $ service_config ): array {
53
53
return [
54
54
'display_name ' => $ service_config ['display_name ' ],
55
- 'endpoint ' => sprintf ( 'https://sheets.googleapis.com/v4/spreadsheets/%s ' , $ service_config ['spreadsheet ' ]['id ' ] ),
55
+ 'endpoint ' => sprintf (
56
+ 'https://sheets.googleapis.com/v4/spreadsheets/%s ' ,
57
+ $ service_config ['spreadsheet ' ]['id ' ]
58
+ ),
56
59
'request_headers ' => function () use ( $ service_config ): array {
57
60
$ access_token = GoogleAuth::generate_token_from_service_account_key (
58
61
$ service_config ['credentials ' ],
@@ -88,7 +91,6 @@ public function ___temp_get_query(): HttpQuery {
88
91
],
89
92
];
90
93
91
-
92
94
foreach ( $ service_config ['sheets ' ][0 ]['output_query_mappings ' ] as $ mapping ) {
93
95
$ mapping_key = $ mapping ['key ' ];
94
96
$ output_schema ['type ' ][ $ mapping_key ] = [
@@ -126,7 +128,6 @@ public function ___temp_get_list_query(): HttpQuery {
126
128
],
127
129
];
128
130
129
-
130
131
foreach ( $ service_config ['sheets ' ][0 ]['output_query_mappings ' ] as $ mapping ) {
131
132
$ mapping_key = $ mapping ['key ' ];
132
133
$ output_schema ['type ' ][ $ mapping_key ] = [
Original file line number Diff line number Diff line change @@ -10,15 +10,21 @@ public static function init(): void {
10
10
}
11
11
12
12
public static function register_blocks (): void {
13
- $ data_source_configs = DataSourceCrud::get_configs_by_service ( REMOTE_DATA_BLOCKS_GOOGLE_SHEETS_SERVICE );
13
+ $ data_source_configs = DataSourceCrud::get_configs_by_service (
14
+ REMOTE_DATA_BLOCKS_GOOGLE_SHEETS_SERVICE
15
+ );
14
16
15
17
foreach ( $ data_source_configs as $ config ) {
16
18
$ data_source = GoogleSheetsDataSource::from_array ( $ config );
17
19
self ::register_block_for_google_sheets_data_source ( $ data_source );
18
20
self ::register_loop_block_for_google_sheets_data_source ( $ data_source );
19
21
}
20
22
}
21
- public static function register_block_for_google_sheets_data_source ( GoogleSheetsDataSource $ data_source , array $ block_overrides = [] ): void {
23
+
24
+ public static function register_block_for_google_sheets_data_source (
25
+ GoogleSheetsDataSource $ data_source ,
26
+ array $ block_overrides = []
27
+ ): void {
22
28
register_remote_data_block (
23
29
array_merge (
24
30
[
@@ -38,7 +44,10 @@ public static function register_block_for_google_sheets_data_source( GoogleSheet
38
44
);
39
45
}
40
46
41
- public static function register_loop_block_for_google_sheets_data_source ( GoogleSheetsDataSource $ data_source , array $ block_overrides = [] ): void {
47
+ public static function register_loop_block_for_google_sheets_data_source (
48
+ GoogleSheetsDataSource $ data_source ,
49
+ array $ block_overrides = []
50
+ ): void {
42
51
register_remote_data_block (
43
52
array_merge (
44
53
[
You can’t perform that action at this time.
0 commit comments