@zapier/zapier-sdk 0.41.2 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/dist/index.cjs +376 -219
- package/dist/index.d.mts +174 -424
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +376 -220
- package/dist/plugins/api/index.d.ts +5 -1
- package/dist/plugins/api/index.d.ts.map +1 -1
- package/dist/plugins/api/index.js +2 -3
- package/dist/plugins/apps/index.d.ts +2 -3
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +1 -1
- package/dist/plugins/capabilities/index.d.ts +8 -6
- package/dist/plugins/capabilities/index.d.ts.map +1 -1
- package/dist/plugins/capabilities/index.js +3 -3
- package/dist/plugins/connections/index.d.ts +3 -1
- package/dist/plugins/connections/index.d.ts.map +1 -1
- package/dist/plugins/connections/index.js +2 -3
- package/dist/plugins/createClientCredentials/index.d.ts +6 -4
- package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/createClientCredentials/index.js +3 -3
- package/dist/plugins/deleteClientCredentials/index.d.ts +6 -4
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +3 -3
- package/dist/plugins/deprecated/authentications.d.ts +9 -9
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.js +4 -4
- package/dist/plugins/eventEmission/index.d.ts +4 -5
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +8 -7
- package/dist/plugins/fetch/index.d.ts +18 -23
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +88 -28
- package/dist/plugins/fetch/schemas.d.ts +8 -0
- package/dist/plugins/fetch/schemas.d.ts.map +1 -1
- package/dist/plugins/fetch/schemas.js +21 -12
- package/dist/plugins/findFirstConnection/index.d.ts +3 -4
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
- package/dist/plugins/findFirstConnection/index.js +2 -2
- package/dist/plugins/findUniqueConnection/index.d.ts +3 -4
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.js +2 -2
- package/dist/plugins/getAction/index.d.ts +7 -7
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +2 -2
- package/dist/plugins/getApp/index.d.ts +2 -3
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +2 -2
- package/dist/plugins/getConnection/index.d.ts +6 -6
- package/dist/plugins/getConnection/index.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.js +3 -3
- package/dist/plugins/getInputFieldsSchema/index.d.ts +8 -6
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +4 -4
- package/dist/plugins/getProfile/index.d.ts +6 -6
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +3 -3
- package/dist/plugins/listActions/index.d.ts +8 -6
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +3 -3
- package/dist/plugins/listApps/index.d.ts +3 -3
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +3 -3
- package/dist/plugins/listClientCredentials/index.d.ts +6 -4
- package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.js +3 -3
- package/dist/plugins/listConnections/index.d.ts +8 -6
- package/dist/plugins/listConnections/index.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.js +5 -5
- package/dist/plugins/listInputFieldChoices/index.d.ts +9 -8
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +4 -4
- package/dist/plugins/listInputFields/index.d.ts +8 -8
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +4 -4
- package/dist/plugins/manifest/index.d.ts +8 -3
- package/dist/plugins/manifest/index.d.ts.map +1 -1
- package/dist/plugins/manifest/index.js +2 -3
- package/dist/plugins/registry/index.d.ts +1 -2
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +3 -3
- package/dist/plugins/request/index.d.ts +3 -4
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +2 -2
- package/dist/plugins/runAction/index.d.ts +8 -8
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +5 -5
- package/dist/plugins/tables/createTable/index.d.ts +3 -5
- package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTable/index.js +3 -3
- package/dist/plugins/tables/createTableFields/index.d.ts +3 -5
- package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.js +3 -3
- package/dist/plugins/tables/createTableRecords/index.d.ts +3 -5
- package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.js +3 -3
- package/dist/plugins/tables/deleteTable/index.d.ts +5 -5
- package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.js +4 -4
- package/dist/plugins/tables/deleteTableFields/index.d.ts +3 -5
- package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.js +3 -3
- package/dist/plugins/tables/deleteTableRecords/index.d.ts +3 -5
- package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.js +3 -3
- package/dist/plugins/tables/getTable/index.d.ts +3 -5
- package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.js +3 -3
- package/dist/plugins/tables/getTableRecord/index.d.ts +3 -5
- package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.js +3 -3
- package/dist/plugins/tables/listTableFields/index.d.ts +3 -5
- package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.js +3 -3
- package/dist/plugins/tables/listTableRecords/index.d.ts +3 -3
- package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.js +3 -3
- package/dist/plugins/tables/listTables/index.d.ts +5 -3
- package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.js +4 -4
- package/dist/plugins/tables/updateTableRecords/index.d.ts +3 -5
- package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/updateTableRecords/index.js +3 -3
- package/dist/resolvers/connectionId.js +1 -1
- package/dist/resolvers/tableId.js +1 -1
- package/dist/sdk.d.ts +29 -257
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +33 -43
- package/dist/types/plugin.d.ts +29 -48
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/plugin.js +7 -3
- package/dist/types/sdk.d.ts +2 -3
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/utils/abort-utils.d.ts +64 -0
- package/dist/utils/abort-utils.d.ts.map +1 -0
- package/dist/utils/abort-utils.js +107 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { CreateTableOptionsSchema, type CreateTableOptions, type CreateTableResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface CreateTablePluginProvides {
|
|
6
6
|
createTable: (options: CreateTableOptions) => Promise<CreateTableResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface CreateTablePluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const createTablePlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, CreateTablePluginProvides>;
|
|
15
|
+
export declare const createTablePlugin: Plugin<ApiPluginProvides & EventEmissionProvides, CreateTablePluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,wBAAwB,EAGxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,wBAAwB,CAAC;aAC9C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,iBAAiB,GAAG,qBAAqB,EACzC,yBAAyB,CAkE1B,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableNameResolver } from "../../../resolvers";
|
|
6
6
|
import { transformTableItem } from "../utils";
|
|
7
|
-
export const createTablePlugin = (
|
|
7
|
+
export const createTablePlugin = (sdk) => {
|
|
8
8
|
async function createTable(options) {
|
|
9
|
-
const { api } = context;
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const rawResponse = await api.post("/tables/api/v1/tables", {
|
|
11
11
|
name: options.name,
|
|
12
12
|
description: options.description,
|
|
@@ -27,7 +27,7 @@ export const createTablePlugin = ({ context }) => {
|
|
|
27
27
|
data: transformTableItem(response.data),
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const createTableDefinition = createFunction(createTable, CreateTableOptionsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, createTable.name));
|
|
30
|
+
const createTableDefinition = createFunction(createTable, CreateTableOptionsSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, createTable.name));
|
|
31
31
|
return {
|
|
32
32
|
createTable: createTableDefinition,
|
|
33
33
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { CreateTableFieldsOptionsSchema, type CreateTableFieldsOptions, type CreateTableFieldsResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface CreateTableFieldsPluginProvides {
|
|
6
6
|
createTableFields: (options: CreateTableFieldsOptions) => Promise<CreateTableFieldsResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface CreateTableFieldsPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const createTableFieldsPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, CreateTableFieldsPluginProvides>;
|
|
15
|
+
export declare const createTableFieldsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, CreateTableFieldsPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,8BAA8B,EAI9B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,iBAAiB,GAAG,qBAAqB,EACzC,+BAA+B,CAoEhC,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableIdResolver, tableFieldsResolver } from "../../../resolvers";
|
|
6
6
|
import { transformFieldItem } from "../utils";
|
|
7
|
-
export const createTableFieldsPlugin = (
|
|
7
|
+
export const createTableFieldsPlugin = (sdk) => {
|
|
8
8
|
async function createTableFields(options) {
|
|
9
|
-
const { api } = context;
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
11
11
|
const rawResponse = await api.post(`/tables/api/v1/tables/${tableId}/fields`, {
|
|
12
12
|
new_fields: options.fields,
|
|
@@ -28,7 +28,7 @@ export const createTableFieldsPlugin = ({ context }) => {
|
|
|
28
28
|
data: response.data.map((changeset) => transformFieldItem(changeset.new)),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const createTableFieldsDefinition = createFunction(createTableFields, CreateTableFieldsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, createTableFields.name));
|
|
31
|
+
const createTableFieldsDefinition = createFunction(createTableFields, CreateTableFieldsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, createTableFields.name));
|
|
32
32
|
return {
|
|
33
33
|
createTableFields: createTableFieldsDefinition,
|
|
34
34
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { CreateTableRecordsOptionsSchema, type CreateTableRecordsOptions, type CreateTableRecordsResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface CreateTableRecordsPluginProvides {
|
|
6
6
|
createTableRecords: (options: CreateTableRecordsOptions) => Promise<CreateTableRecordsResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface CreateTableRecordsPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const createTableRecordsPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, CreateTableRecordsPluginProvides>;
|
|
15
|
+
export declare const createTableRecordsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, CreateTableRecordsPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,+BAA+B,EAI/B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAYjE,MAAM,WAAW,gCAAgC;IAC/C,kBAAkB,EAAE,CAClB,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,kBAAkB,EAAE;gBAClB,WAAW,EAAE,OAAO,+BAA+B,CAAC;aACrD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,iBAAiB,GAAG,qBAAqB,EACzC,gCAAgC,CAuFjC,CAAC"}
|
|
@@ -5,9 +5,9 @@ import { ZapierAuthenticationError } from "../../../types/errors";
|
|
|
5
5
|
import { tableIdResolver, tableRecordsResolver } from "../../../resolvers";
|
|
6
6
|
import { tableRecordFormatter } from "../../../formatters";
|
|
7
7
|
import { createFieldKeyTranslator, transformRecordItem, throwOnRecordErrors, throwOnResponseErrors, } from "../utils";
|
|
8
|
-
export const createTableRecordsPlugin = (
|
|
8
|
+
export const createTableRecordsPlugin = (sdk) => {
|
|
9
9
|
async function createTableRecords(options) {
|
|
10
|
-
const { api } = context;
|
|
10
|
+
const { api } = sdk.context;
|
|
11
11
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
12
12
|
const translator = await createFieldKeyTranslator({
|
|
13
13
|
api,
|
|
@@ -45,7 +45,7 @@ export const createTableRecordsPlugin = ({ context }) => {
|
|
|
45
45
|
})),
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
const createTableRecordsDefinition = createFunction(createTableRecords, CreateTableRecordsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, createTableRecords.name));
|
|
48
|
+
const createTableRecordsDefinition = createFunction(createTableRecords, CreateTableRecordsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, createTableRecords.name));
|
|
49
49
|
return {
|
|
50
50
|
createTableRecords: createTableRecordsDefinition,
|
|
51
51
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { DeleteTableOptionsSchema, type DeleteTableOptions, type DeleteTableResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
import type { CapabilitiesContext } from "../../capabilities";
|
|
6
6
|
export interface DeleteTablePluginProvides {
|
|
7
7
|
deleteTable: (options: DeleteTableOptions) => Promise<DeleteTableResult>;
|
|
@@ -13,7 +13,7 @@ export interface DeleteTablePluginProvides {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export declare const deleteTablePlugin: Plugin<
|
|
17
|
-
|
|
18
|
-
}
|
|
16
|
+
export declare const deleteTablePlugin: Plugin<ApiPluginProvides & EventEmissionProvides & {
|
|
17
|
+
context: CapabilitiesContext;
|
|
18
|
+
}, DeleteTablePluginProvides>;
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/deleteTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/deleteTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,wBAAwB,EAExB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,wBAAwB,CAAC;aAC9C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,iBAAiB,GAAG,qBAAqB,GAAG;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,EAC5E,yBAAyB,CA2D1B,CAAC"}
|
|
@@ -3,10 +3,10 @@ import { DeleteTableOptionsSchema, DeleteTableOptionsInputSchema, } from "./sche
|
|
|
3
3
|
import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableIdResolver } from "../../../resolvers";
|
|
6
|
-
export const deleteTablePlugin = (
|
|
6
|
+
export const deleteTablePlugin = (sdk) => {
|
|
7
7
|
async function deleteTable(options) {
|
|
8
|
-
await context.checkCapability("canDeleteTables");
|
|
9
|
-
const { api } = context;
|
|
8
|
+
await sdk.context.checkCapability("canDeleteTables");
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
11
11
|
await api.delete(`/tables/api/v1/tables/${tableId}`, undefined, {
|
|
12
12
|
customErrorHandler: ({ status }) => {
|
|
@@ -24,7 +24,7 @@ export const deleteTablePlugin = ({ context }) => {
|
|
|
24
24
|
success: true,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const deleteTableDefinition = createFunction(deleteTable, DeleteTableOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, deleteTable.name));
|
|
27
|
+
const deleteTableDefinition = createFunction(deleteTable, DeleteTableOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, deleteTable.name));
|
|
28
28
|
return {
|
|
29
29
|
deleteTable: deleteTableDefinition,
|
|
30
30
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { DeleteTableFieldsOptionsSchema, type DeleteTableFieldsOptions, type DeleteTableFieldsResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface DeleteTableFieldsPluginProvides {
|
|
6
6
|
deleteTableFields: (options: DeleteTableFieldsOptions) => Promise<DeleteTableFieldsResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface DeleteTableFieldsPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const deleteTableFieldsPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, DeleteTableFieldsPluginProvides>;
|
|
15
|
+
export declare const deleteTableFieldsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, DeleteTableFieldsPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/deleteTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/deleteTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,8BAA8B,EAE9B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,iBAAiB,GAAG,qBAAqB,EACzC,+BAA+B,CAsEhC,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableIdResolver, tableFieldIdsResolver } from "../../../resolvers";
|
|
6
6
|
import { resolveFieldKeys } from "../utils";
|
|
7
|
-
export const deleteTableFieldsPlugin = (
|
|
7
|
+
export const deleteTableFieldsPlugin = (sdk) => {
|
|
8
8
|
async function deleteTableFields(options) {
|
|
9
|
-
const { api } = context;
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
11
11
|
const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
|
|
12
12
|
const numericFieldIds = await resolveFieldKeys({
|
|
@@ -30,7 +30,7 @@ export const deleteTableFieldsPlugin = ({ context }) => {
|
|
|
30
30
|
success: true,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
const deleteTableFieldsDefinition = createFunction(deleteTableFields, DeleteTableFieldsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, deleteTableFields.name));
|
|
33
|
+
const deleteTableFieldsDefinition = createFunction(deleteTableFields, DeleteTableFieldsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, deleteTableFields.name));
|
|
34
34
|
return {
|
|
35
35
|
deleteTableFields: deleteTableFieldsDefinition,
|
|
36
36
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { DeleteTableRecordsOptionsSchema, type DeleteTableRecordsOptions, type DeleteTableRecordsResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface DeleteTableRecordsPluginProvides {
|
|
6
6
|
deleteTableRecords: (options: DeleteTableRecordsOptions) => Promise<DeleteTableRecordsResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface DeleteTableRecordsPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const deleteTableRecordsPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, DeleteTableRecordsPluginProvides>;
|
|
15
|
+
export declare const deleteTableRecordsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, DeleteTableRecordsPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/deleteTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/deleteTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,+BAA+B,EAE/B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAKjE,MAAM,WAAW,gCAAgC;IAC/C,kBAAkB,EAAE,CAClB,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,kBAAkB,EAAE;gBAClB,WAAW,EAAE,OAAO,+BAA+B,CAAC;aACrD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,iBAAiB,GAAG,qBAAqB,EACzC,gCAAgC,CAiEjC,CAAC"}
|
|
@@ -3,9 +3,9 @@ import { DeleteTableRecordsOptionsSchema, DeleteTableRecordsOptionsInputSchema,
|
|
|
3
3
|
import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableIdResolver, tableRecordIdsResolver } from "../../../resolvers";
|
|
6
|
-
export const deleteTableRecordsPlugin = (
|
|
6
|
+
export const deleteTableRecordsPlugin = (sdk) => {
|
|
7
7
|
async function deleteTableRecords(options) {
|
|
8
|
-
const { api } = context;
|
|
8
|
+
const { api } = sdk.context;
|
|
9
9
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
10
10
|
const recordIds = "records" in options ? options.records : options.recordIds;
|
|
11
11
|
await api.delete(`/tables/api/v1/tables/${tableId}/records`, { record_ids: recordIds }, {
|
|
@@ -24,7 +24,7 @@ export const deleteTableRecordsPlugin = ({ context }) => {
|
|
|
24
24
|
success: true,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const deleteTableRecordsDefinition = createFunction(deleteTableRecords, DeleteTableRecordsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, deleteTableRecords.name));
|
|
27
|
+
const deleteTableRecordsDefinition = createFunction(deleteTableRecords, DeleteTableRecordsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, deleteTableRecords.name));
|
|
28
28
|
return {
|
|
29
29
|
deleteTableRecords: deleteTableRecordsDefinition,
|
|
30
30
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { GetTableOptionsSchema, type GetTableOptions, type TableItem } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface GetTablePluginProvides {
|
|
6
6
|
getTable: (options: GetTableOptions) => Promise<{
|
|
7
7
|
data: TableItem;
|
|
@@ -14,7 +14,5 @@ export interface GetTablePluginProvides {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export declare const getTablePlugin: Plugin<
|
|
18
|
-
api: ApiClient;
|
|
19
|
-
} & EventEmissionContext, GetTablePluginProvides>;
|
|
17
|
+
export declare const getTablePlugin: Plugin<ApiPluginProvides & EventEmissionProvides, GetTablePluginProvides>;
|
|
20
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/getTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/getTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAEL,qBAAqB,EAGrB,KAAK,eAAe,EACpB,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACrE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,WAAW,EAAE,OAAO,qBAAqB,CAAC;aAC3C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,iBAAiB,GAAG,qBAAqB,EACzC,sBAAsB,CA8DvB,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableIdResolver } from "../../../resolvers";
|
|
6
6
|
import { transformTableItem } from "../utils";
|
|
7
|
-
export const getTablePlugin = (
|
|
7
|
+
export const getTablePlugin = (sdk) => {
|
|
8
8
|
async function getTable(options) {
|
|
9
|
-
const { api } = context;
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
11
11
|
const rawResponse = await api.get(`/tables/api/v1/tables/${tableId}`, {
|
|
12
12
|
customErrorHandler: ({ status }) => {
|
|
@@ -28,7 +28,7 @@ export const getTablePlugin = ({ context }) => {
|
|
|
28
28
|
data: transformTableItem(response.data),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const getTableDefinition = createFunction(getTable, GetTableOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getTable.name));
|
|
31
|
+
const getTableDefinition = createFunction(getTable, GetTableOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getTable.name));
|
|
32
32
|
return {
|
|
33
33
|
getTable: getTableDefinition,
|
|
34
34
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { GetTableRecordOptionsSchema, type GetTableRecordOptions, type GetTableRecordResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface GetTableRecordPluginProvides {
|
|
6
6
|
getTableRecord: (options: GetTableRecordOptions) => Promise<GetTableRecordResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface GetTableRecordPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const getTableRecordPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, GetTableRecordPluginProvides>;
|
|
15
|
+
export declare const getTableRecordPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, GetTableRecordPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/getTableRecord/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/getTableRecord/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,2BAA2B,EAI3B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAQjE,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,CACd,OAAO,EAAE,qBAAqB,KAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,cAAc,EAAE;gBACd,WAAW,EAAE,OAAO,2BAA2B,CAAC;aACjD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,iBAAiB,GAAG,qBAAqB,EACzC,4BAA4B,CA8E7B,CAAC"}
|
|
@@ -6,9 +6,9 @@ import { tableIdResolver, tableRecordIdResolver } from "../../../resolvers";
|
|
|
6
6
|
import { tableRecordFormatter } from "../../../formatters";
|
|
7
7
|
import { createFieldKeyTranslator } from "../utils";
|
|
8
8
|
import { transformRecordItem } from "../utils";
|
|
9
|
-
export const getTableRecordPlugin = (
|
|
9
|
+
export const getTableRecordPlugin = (sdk) => {
|
|
10
10
|
async function getTableRecord(options) {
|
|
11
|
-
const { api } = context;
|
|
11
|
+
const { api } = sdk.context;
|
|
12
12
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
13
13
|
const recordId = "record" in options ? options.record : options.recordId;
|
|
14
14
|
const rawResponse = await api.get(`/tables/api/v1/tables/${tableId}/records/${recordId}`, {
|
|
@@ -39,7 +39,7 @@ export const getTableRecordPlugin = ({ context }) => {
|
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
const getTableRecordDefinition = createFunction(getTableRecord, GetTableRecordOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getTableRecord.name));
|
|
42
|
+
const getTableRecordDefinition = createFunction(getTableRecord, GetTableRecordOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getTableRecord.name));
|
|
43
43
|
return {
|
|
44
44
|
getTableRecord: getTableRecordDefinition,
|
|
45
45
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { ListTableFieldsOptionsSchema, type ListTableFieldsOptions, type ListTableFieldsResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface ListTableFieldsPluginProvides {
|
|
6
6
|
listTableFields: (options: ListTableFieldsOptions) => Promise<ListTableFieldsResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface ListTableFieldsPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const listTableFieldsPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, ListTableFieldsPluginProvides>;
|
|
15
|
+
export declare const listTableFieldsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, ListTableFieldsPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTableFields/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,4BAA4B,EAI5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,CACf,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,eAAe,EAAE;gBACf,WAAW,EAAE,OAAO,4BAA4B,CAAC;aAClD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,iBAAiB,GAAG,qBAAqB,EACzC,6BAA6B,CA+E9B,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { createTelemetryCallback } from "../../../utils/telemetry-utils";
|
|
|
4
4
|
import { ZapierAuthenticationError } from "../../../types/errors";
|
|
5
5
|
import { tableIdResolver } from "../../../resolvers";
|
|
6
6
|
import { resolveFieldKeys, transformFieldItem } from "../utils";
|
|
7
|
-
export const listTableFieldsPlugin = (
|
|
7
|
+
export const listTableFieldsPlugin = (sdk) => {
|
|
8
8
|
async function listTableFields(options) {
|
|
9
|
-
const { api } = context;
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
11
11
|
const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
|
|
12
12
|
const searchParams = {};
|
|
@@ -39,7 +39,7 @@ export const listTableFieldsPlugin = ({ context }) => {
|
|
|
39
39
|
data: response.data.map(transformFieldItem),
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
const listTableFieldsDefinition = createFunction(listTableFields, ListTableFieldsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, listTableFields.name));
|
|
42
|
+
const listTableFieldsDefinition = createFunction(listTableFields, ListTableFieldsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, listTableFields.name));
|
|
43
43
|
return {
|
|
44
44
|
listTableFields: listTableFieldsDefinition,
|
|
45
45
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Plugin } from "../../../types/plugin";
|
|
2
2
|
import { ListTableRecordsOptionsSchema, type ListTableRecordsOptions, type RecordItem } from "./schemas";
|
|
3
3
|
import type { ApiPluginProvides } from "../../api";
|
|
4
|
-
import type {
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface ListTableRecordsPluginProvides {
|
|
6
6
|
listTableRecords: (options: ListTableRecordsOptions) => Promise<{
|
|
7
7
|
data: RecordItem[];
|
|
@@ -20,5 +20,5 @@ export interface ListTableRecordsPluginProvides {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
export declare const listTableRecordsPlugin: Plugin<
|
|
23
|
+
export declare const listTableRecordsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, ListTableRecordsPluginProvides>;
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAEL,6BAA6B,EAG7B,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AA6BjE,MAAM,WAAW,8BAA8B;IAC7C,gBAAgB,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC;QAC9D,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;KACpC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,gBAAgB,EAAE;gBAChB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,iBAAiB,GAAG,qBAAqB,EACzC,8BAA8B,CAmH/B,CAAC"}
|
|
@@ -13,9 +13,9 @@ function extractNextCursor(meta) {
|
|
|
13
13
|
}
|
|
14
14
|
return meta.pagination.end_cursor;
|
|
15
15
|
}
|
|
16
|
-
export const listTableRecordsPlugin = (
|
|
16
|
+
export const listTableRecordsPlugin = (sdk) => {
|
|
17
17
|
async function listTableRecordsPage(options) {
|
|
18
|
-
const { api } = context;
|
|
18
|
+
const { api } = sdk.context;
|
|
19
19
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
20
20
|
const translator = await createFieldKeyTranslator({
|
|
21
21
|
api,
|
|
@@ -74,7 +74,7 @@ export const listTableRecordsPlugin = ({ context }) => {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
const methodName = stripPageSuffix(listTableRecordsPage.name);
|
|
77
|
-
const listTableRecordsDefinition = createPaginatedFunction(listTableRecordsPage, ListTableRecordsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
77
|
+
const listTableRecordsDefinition = createPaginatedFunction(listTableRecordsPage, ListTableRecordsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
78
78
|
return {
|
|
79
79
|
listTableRecords: listTableRecordsDefinition,
|
|
80
80
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Plugin } from "../../../types/plugin";
|
|
2
2
|
import { ListTablesOptionsSchema, type ListTablesOptions, type TableItem } from "./schemas";
|
|
3
3
|
import type { ApiPluginProvides } from "../../api";
|
|
4
|
-
import type {
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
import type { CapabilitiesContext } from "../../capabilities";
|
|
6
6
|
export interface ListTablesPluginProvides {
|
|
7
7
|
listTables: (options?: ListTablesOptions) => Promise<{
|
|
@@ -21,5 +21,7 @@ export interface ListTablesPluginProvides {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
export declare const listTablesPlugin: Plugin<
|
|
24
|
+
export declare const listTablesPlugin: Plugin<ApiPluginProvides & EventEmissionProvides & {
|
|
25
|
+
context: CapabilitiesContext;
|
|
26
|
+
}, ListTablesPluginProvides>;
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTables/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTables/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAEL,uBAAuB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAOjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmB9D,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC;QACnD,IAAI,EAAE,SAAS,EAAE,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC1D,KAAK,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;KACnC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,uBAAuB,CAAC;aAC7C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,iBAAiB,GAAG,qBAAqB,GAAG;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,EAC5E,wBAAwB,CAsGzB,CAAC"}
|
|
@@ -18,12 +18,12 @@ function extractNextCursor(links) {
|
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
export const listTablesPlugin = (
|
|
21
|
+
export const listTablesPlugin = (sdk) => {
|
|
22
22
|
async function listTablesPage(options) {
|
|
23
23
|
if (options.includeShared) {
|
|
24
|
-
await context.checkCapability("canIncludeSharedTables");
|
|
24
|
+
await sdk.context.checkCapability("canIncludeSharedTables");
|
|
25
25
|
}
|
|
26
|
-
const { api } = context;
|
|
26
|
+
const { api } = sdk.context;
|
|
27
27
|
const searchParams = {};
|
|
28
28
|
if (options.pageSize !== undefined) {
|
|
29
29
|
searchParams.limit = options.pageSize.toString();
|
|
@@ -76,7 +76,7 @@ export const listTablesPlugin = ({ context }) => {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
const methodName = stripPageSuffix(listTablesPage.name);
|
|
79
|
-
const listTablesDefinition = createPaginatedFunction(listTablesPage, ListTablesOptionsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
79
|
+
const listTablesDefinition = createPaginatedFunction(listTablesPage, ListTablesOptionsSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
80
80
|
return {
|
|
81
81
|
listTables: listTablesDefinition,
|
|
82
82
|
context: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from "../../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../../api";
|
|
3
2
|
import { UpdateTableRecordsOptionsSchema, type UpdateTableRecordsOptions, type UpdateTableRecordsResult } from "./schemas";
|
|
4
|
-
import type {
|
|
3
|
+
import type { ApiPluginProvides } from "../../api";
|
|
4
|
+
import type { EventEmissionProvides } from "../../eventEmission";
|
|
5
5
|
export interface UpdateTableRecordsPluginProvides {
|
|
6
6
|
updateTableRecords: (options: UpdateTableRecordsOptions) => Promise<UpdateTableRecordsResult>;
|
|
7
7
|
context: {
|
|
@@ -12,7 +12,5 @@ export interface UpdateTableRecordsPluginProvides {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const updateTableRecordsPlugin: Plugin<
|
|
16
|
-
api: ApiClient;
|
|
17
|
-
} & EventEmissionContext, UpdateTableRecordsPluginProvides>;
|
|
15
|
+
export declare const updateTableRecordsPlugin: Plugin<ApiPluginProvides & EventEmissionProvides, UpdateTableRecordsPluginProvides>;
|
|
18
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/updateTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/updateTableRecords/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EACL,+BAA+B,EAI/B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAejE,MAAM,WAAW,gCAAgC;IAC/C,kBAAkB,EAAE,CAClB,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,kBAAkB,EAAE;gBAClB,WAAW,EAAE,OAAO,+BAA+B,CAAC;aACrD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,iBAAiB,GAAG,qBAAqB,EACzC,gCAAgC,CAwFjC,CAAC"}
|
|
@@ -5,9 +5,9 @@ import { ZapierAuthenticationError } from "../../../types/errors";
|
|
|
5
5
|
import { tableIdResolver, tableUpdateRecordsResolver, } from "../../../resolvers";
|
|
6
6
|
import { tableRecordFormatter } from "../../../formatters";
|
|
7
7
|
import { createFieldKeyTranslator, transformRecordItem, throwOnRecordErrors, throwOnResponseErrors, } from "../utils";
|
|
8
|
-
export const updateTableRecordsPlugin = (
|
|
8
|
+
export const updateTableRecordsPlugin = (sdk) => {
|
|
9
9
|
async function updateTableRecords(options) {
|
|
10
|
-
const { api } = context;
|
|
10
|
+
const { api } = sdk.context;
|
|
11
11
|
const tableId = "table" in options ? options.table : options.tableId;
|
|
12
12
|
const translator = await createFieldKeyTranslator({
|
|
13
13
|
api,
|
|
@@ -46,7 +46,7 @@ export const updateTableRecordsPlugin = ({ context }) => {
|
|
|
46
46
|
})),
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
const updateTableRecordsDefinition = createFunction(updateTableRecords, UpdateTableRecordsOptionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, updateTableRecords.name));
|
|
49
|
+
const updateTableRecordsDefinition = createFunction(updateTableRecords, UpdateTableRecordsOptionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, updateTableRecords.name));
|
|
50
50
|
return {
|
|
51
51
|
updateTableRecords: updateTableRecordsDefinition,
|
|
52
52
|
context: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toIterable } from "../utils/pagination-utils";
|
|
2
2
|
async function fetchConnections(sdk, resolvedParams) {
|
|
3
|
-
const context = sdk.
|
|
3
|
+
const context = sdk.context;
|
|
4
4
|
const includeShared = await context.hasCapability?.("canIncludeSharedConnections");
|
|
5
5
|
return toIterable(sdk.listConnections({
|
|
6
6
|
app: resolvedParams.app,
|