@zapier/zapier-sdk 0.40.4 → 0.41.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 +12 -12
- package/dist/api/schemas.d.ts +1 -0
- package/dist/api/schemas.d.ts.map +1 -1
- package/dist/api/schemas.js +1 -0
- package/dist/index.cjs +78 -6
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +78 -6
- package/dist/plugins/getConnection/index.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.js +6 -1
- package/dist/plugins/getProfile/index.js +1 -1
- package/dist/plugins/listConnections/index.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.js +5 -2
- package/dist/plugins/tables/createTable/schemas.d.ts +2 -0
- package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/schemas.d.ts +2 -0
- package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/schemas.d.ts +5 -1
- package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/schemas.js +3 -1
- package/dist/plugins/tables/utils.d.ts.map +1 -1
- package/dist/plugins/tables/utils.js +3 -2
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +30 -0
- package/dist/utils/domain-utils.d.ts +7 -1
- package/dist/utils/domain-utils.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +35 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.41.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53c165a: `formatErrorMessage` now renders `ZapierRateLimitError` details (limit used, time until retry, retry count) instead of just the bare "Rate limited" message. CLI, MCP, and any consumer using `formatErrorMessage` now surface which rate-limit window tripped and how long until it resets.
|
|
8
|
+
|
|
9
|
+
## 0.41.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 912e960: Prefer public IDs over numeric IDs in responses
|
|
14
|
+
|
|
3
15
|
## 0.40.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1208,18 +1208,18 @@ List records in a table with optional filtering and sorting
|
|
|
1208
1208
|
|
|
1209
1209
|
**Parameters:**
|
|
1210
1210
|
|
|
1211
|
-
| Name
|
|
1212
|
-
|
|
|
1213
|
-
| `options`
|
|
1214
|
-
| ↳ `table`
|
|
1215
|
-
| ↳ `filters`
|
|
1216
|
-
| ↳ `sort`
|
|
1217
|
-
|
|
|
1218
|
-
|
|
|
1219
|
-
| ↳ `pageSize`
|
|
1220
|
-
| ↳ `maxItems`
|
|
1221
|
-
| ↳ `cursor`
|
|
1222
|
-
| ↳ `keyMode`
|
|
1211
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1212
|
+
| ---------------- | -------- | -------- | --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
1213
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1214
|
+
| ↳ `table` | `string` | ✅ | — | — | The unique identifier of the table |
|
|
1215
|
+
| ↳ `filters` | `array` | ❌ | — | — | Filter conditions for the query |
|
|
1216
|
+
| ↳ `sort` | `object` | ❌ | — | — | Sort records by a field |
|
|
1217
|
+
| ↳ `fieldKey` | `string` | ✅ | — | — | The field key to sort by |
|
|
1218
|
+
| ↳ `direction` | `string` | ❌ | `"asc"` | — | Sort direction |
|
|
1219
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of records per page (max 1000) |
|
|
1220
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
1221
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
1222
|
+
| ↳ `keyMode` | `string` | ❌ | `"names"` | — | How to interpret field keys in record data. "names" (default) uses human-readable field names, "ids" uses raw field IDs (f1, f2). |
|
|
1223
1223
|
|
|
1224
1224
|
**Returns:** `Promise<PaginatedResult<RecordItem>>`
|
|
1225
1225
|
|
package/dist/api/schemas.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ export declare const ActionFieldSchema: z.ZodObject<{
|
|
|
132
132
|
}, z.core.$strip>;
|
|
133
133
|
export declare const UserProfileSchema: z.ZodObject<{
|
|
134
134
|
id: z.ZodNumber;
|
|
135
|
+
public_id: z.ZodOptional<z.ZodString>;
|
|
135
136
|
code: z.ZodString;
|
|
136
137
|
user_id: z.ZodNumber;
|
|
137
138
|
auto_provisioned: z.ZodBoolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAMH,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CrB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;iBAE5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;iBAkBvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;iBAGvB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAetB,CAAC;AAEH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;iBAe5B,CAAC;AAMH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAA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AAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;iBAsCnC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;iBAOpC,CAAC"}
|
package/dist/api/schemas.js
CHANGED
|
@@ -129,6 +129,7 @@ export const ActionFieldSchema = z.object({
|
|
|
129
129
|
// ============================================================================
|
|
130
130
|
export const UserProfileSchema = z.object({
|
|
131
131
|
id: z.number(),
|
|
132
|
+
public_id: z.string().optional(),
|
|
132
133
|
code: z.string(),
|
|
133
134
|
user_id: z.number(),
|
|
134
135
|
auto_provisioned: z.boolean(),
|
package/dist/index.cjs
CHANGED
|
@@ -270,12 +270,42 @@ ${context.join(", ")}`;
|
|
|
270
270
|
if (error instanceof ZapierBundleError && error.buildErrors && error.buildErrors.length > 0) {
|
|
271
271
|
message += "\n\nBuild errors:\n" + error.buildErrors.map((err) => ` \u2022 ${err}`).join("\n");
|
|
272
272
|
}
|
|
273
|
+
if (error instanceof ZapierRateLimitError) {
|
|
274
|
+
const { limit, remaining, retryAfterMs } = error.rateLimit;
|
|
275
|
+
const parts = [];
|
|
276
|
+
if (limit !== void 0) {
|
|
277
|
+
const used = remaining !== void 0 ? limit - remaining : limit;
|
|
278
|
+
parts.push(`${used}/${limit} used`);
|
|
279
|
+
}
|
|
280
|
+
if (retryAfterMs !== void 0 && retryAfterMs > 0) {
|
|
281
|
+
parts.push(`retry in ${formatDuration(retryAfterMs)}`);
|
|
282
|
+
}
|
|
283
|
+
if (error.retries > 0) {
|
|
284
|
+
parts.push(
|
|
285
|
+
`after ${error.retries} retr${error.retries === 1 ? "y" : "ies"}`
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
if (parts.length > 0) {
|
|
289
|
+
message += `
|
|
290
|
+
${parts.join(", ")}`;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
273
293
|
if (error.statusCode && !message.includes(`${error.statusCode}`)) {
|
|
274
294
|
message += `
|
|
275
295
|
HTTP Status: ${error.statusCode}`;
|
|
276
296
|
}
|
|
277
297
|
return message;
|
|
278
298
|
}
|
|
299
|
+
function formatDuration(ms) {
|
|
300
|
+
const seconds = Math.round(ms / 1e3);
|
|
301
|
+
if (seconds < 60) return `${seconds}s`;
|
|
302
|
+
const minutes = Math.round(seconds / 60);
|
|
303
|
+
if (minutes < 60) return `${minutes}m`;
|
|
304
|
+
const hours = Math.round(minutes / 60);
|
|
305
|
+
if (hours < 24) return `${hours}h`;
|
|
306
|
+
const days = Math.round(hours / 24);
|
|
307
|
+
return `${days}d`;
|
|
308
|
+
}
|
|
279
309
|
var ActionExecutionInputSchema = zod.z.object({
|
|
280
310
|
inputs: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
281
311
|
/** @deprecated Use `connection` instead. */
|
|
@@ -617,6 +647,34 @@ function normalizeActionItem(action) {
|
|
|
617
647
|
type: "action"
|
|
618
648
|
};
|
|
619
649
|
}
|
|
650
|
+
function transformConnectionItem(item) {
|
|
651
|
+
const raw = item;
|
|
652
|
+
const publicId = raw.public_id;
|
|
653
|
+
const accountPublicId = raw.account_public_id;
|
|
654
|
+
const customuserPublicId = raw.customuser_public_id;
|
|
655
|
+
return {
|
|
656
|
+
id: String(publicId ?? item.id),
|
|
657
|
+
date: item.date,
|
|
658
|
+
account_id: String(accountPublicId ?? item.account_id),
|
|
659
|
+
is_invite_only: item.is_invite_only,
|
|
660
|
+
is_private: item.is_private,
|
|
661
|
+
shared_with_all: item.shared_with_all,
|
|
662
|
+
title: item.title,
|
|
663
|
+
lastchanged: item.lastchanged,
|
|
664
|
+
is_stale: item.is_stale,
|
|
665
|
+
is_shared: item.is_shared,
|
|
666
|
+
identifier: item.identifier,
|
|
667
|
+
groups: item.groups,
|
|
668
|
+
members: item.members,
|
|
669
|
+
permissions: item.permissions,
|
|
670
|
+
implementation_id: item.implementation_id,
|
|
671
|
+
profile_id: customuserPublicId ? String(customuserPublicId) : item.profile_id,
|
|
672
|
+
is_expired: item.is_expired,
|
|
673
|
+
expired_at: item.expired_at,
|
|
674
|
+
app_key: item.app_key,
|
|
675
|
+
app_version: item.app_version
|
|
676
|
+
};
|
|
677
|
+
}
|
|
620
678
|
function isSlug(slug) {
|
|
621
679
|
return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
622
680
|
}
|
|
@@ -1599,6 +1657,7 @@ zod.z.object({
|
|
|
1599
1657
|
});
|
|
1600
1658
|
zod.z.object({
|
|
1601
1659
|
id: zod.z.number(),
|
|
1660
|
+
public_id: zod.z.string().optional(),
|
|
1602
1661
|
code: zod.z.string(),
|
|
1603
1662
|
user_id: zod.z.number(),
|
|
1604
1663
|
auto_provisioned: zod.z.boolean(),
|
|
@@ -2104,8 +2163,12 @@ function transformTableItem(apiItem) {
|
|
|
2104
2163
|
created_at: apiItem.created_at,
|
|
2105
2164
|
edited_at: apiItem.edited_at,
|
|
2106
2165
|
kind: apiItem.kind,
|
|
2107
|
-
|
|
2108
|
-
|
|
2166
|
+
account_id: String(
|
|
2167
|
+
apiItem.owner_account_public_id ?? apiItem.owner_account_id
|
|
2168
|
+
),
|
|
2169
|
+
profile_id: String(
|
|
2170
|
+
apiItem.owner_zapier_customuser_public_id ?? apiItem.owner_zapier_customuser_id
|
|
2171
|
+
),
|
|
2109
2172
|
parent_table_id: apiItem.parent_table_id ?? void 0
|
|
2110
2173
|
};
|
|
2111
2174
|
}
|
|
@@ -3321,7 +3384,10 @@ var listConnectionsPlugin = ({ context }) => {
|
|
|
3321
3384
|
authRequired: true
|
|
3322
3385
|
}
|
|
3323
3386
|
);
|
|
3324
|
-
return
|
|
3387
|
+
return {
|
|
3388
|
+
...response,
|
|
3389
|
+
data: response.data.map(transformConnectionItem)
|
|
3390
|
+
};
|
|
3325
3391
|
}
|
|
3326
3392
|
const methodName = stripPageSuffix(listConnectionsPage.name);
|
|
3327
3393
|
const listConnectionsDefinition = createPaginatedFunction(
|
|
@@ -3718,9 +3784,13 @@ var getConnectionPlugin = ({ context }) => {
|
|
|
3718
3784
|
if (!resolvedConnectionId) {
|
|
3719
3785
|
throw new Error("connection is required");
|
|
3720
3786
|
}
|
|
3721
|
-
|
|
3787
|
+
const response = await api.get(
|
|
3722
3788
|
`/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`
|
|
3723
3789
|
);
|
|
3790
|
+
return {
|
|
3791
|
+
...response,
|
|
3792
|
+
data: transformConnectionItem(response.data)
|
|
3793
|
+
};
|
|
3724
3794
|
}
|
|
3725
3795
|
const getConnectionDefinition = createFunction(
|
|
3726
3796
|
getConnection,
|
|
@@ -4680,7 +4750,7 @@ var getProfilePlugin = ({ context }) => {
|
|
|
4680
4750
|
);
|
|
4681
4751
|
return {
|
|
4682
4752
|
data: {
|
|
4683
|
-
id: String(profile.id),
|
|
4753
|
+
id: String(profile.public_id ?? profile.id),
|
|
4684
4754
|
first_name: profile.first_name,
|
|
4685
4755
|
last_name: profile.last_name,
|
|
4686
4756
|
full_name: `${profile.first_name} ${profile.last_name}`,
|
|
@@ -6097,8 +6167,10 @@ var TableApiItemSchema = zod.z.object({
|
|
|
6097
6167
|
edited_at: zod.z.string(),
|
|
6098
6168
|
kind: zod.z.enum(["table", "virtual_table"]),
|
|
6099
6169
|
owner_account_id: zod.z.number(),
|
|
6170
|
+
owner_account_public_id: zod.z.string().optional(),
|
|
6100
6171
|
owner_user_id: zod.z.number().nullable().optional(),
|
|
6101
6172
|
owner_zapier_customuser_id: zod.z.number(),
|
|
6173
|
+
owner_zapier_customuser_public_id: zod.z.string().optional(),
|
|
6102
6174
|
parent_table_id: zod.z.string().nullable().optional()
|
|
6103
6175
|
});
|
|
6104
6176
|
var ListTablesApiResponseSchema = zod.z.object({
|
|
@@ -6114,7 +6186,7 @@ var TableItemSchema = zod.z.object({
|
|
|
6114
6186
|
created_at: zod.z.string(),
|
|
6115
6187
|
edited_at: zod.z.string(),
|
|
6116
6188
|
kind: zod.z.enum(["table", "virtual_table"]),
|
|
6117
|
-
|
|
6189
|
+
account_id: zod.z.string(),
|
|
6118
6190
|
profile_id: zod.z.string(),
|
|
6119
6191
|
parent_table_id: zod.z.string().optional()
|
|
6120
6192
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -696,6 +696,7 @@ declare const ActionFieldSchema: z.ZodObject<{
|
|
|
696
696
|
}, z.core.$strip>;
|
|
697
697
|
declare const UserProfileSchema: z.ZodObject<{
|
|
698
698
|
id: z.ZodNumber;
|
|
699
|
+
public_id: z.ZodOptional<z.ZodString>;
|
|
699
700
|
code: z.ZodString;
|
|
700
701
|
user_id: z.ZodNumber;
|
|
701
702
|
auto_provisioned: z.ZodBoolean;
|
|
@@ -2376,7 +2377,7 @@ declare const TableItemSchema: z.ZodObject<{
|
|
|
2376
2377
|
table: "table";
|
|
2377
2378
|
virtual_table: "virtual_table";
|
|
2378
2379
|
}>;
|
|
2379
|
-
|
|
2380
|
+
account_id: z.ZodString;
|
|
2380
2381
|
profile_id: z.ZodString;
|
|
2381
2382
|
parent_table_id: z.ZodOptional<z.ZodString>;
|
|
2382
2383
|
}, z.core.$strip>;
|
package/dist/index.mjs
CHANGED
|
@@ -268,12 +268,42 @@ ${context.join(", ")}`;
|
|
|
268
268
|
if (error instanceof ZapierBundleError && error.buildErrors && error.buildErrors.length > 0) {
|
|
269
269
|
message += "\n\nBuild errors:\n" + error.buildErrors.map((err) => ` \u2022 ${err}`).join("\n");
|
|
270
270
|
}
|
|
271
|
+
if (error instanceof ZapierRateLimitError) {
|
|
272
|
+
const { limit, remaining, retryAfterMs } = error.rateLimit;
|
|
273
|
+
const parts = [];
|
|
274
|
+
if (limit !== void 0) {
|
|
275
|
+
const used = remaining !== void 0 ? limit - remaining : limit;
|
|
276
|
+
parts.push(`${used}/${limit} used`);
|
|
277
|
+
}
|
|
278
|
+
if (retryAfterMs !== void 0 && retryAfterMs > 0) {
|
|
279
|
+
parts.push(`retry in ${formatDuration(retryAfterMs)}`);
|
|
280
|
+
}
|
|
281
|
+
if (error.retries > 0) {
|
|
282
|
+
parts.push(
|
|
283
|
+
`after ${error.retries} retr${error.retries === 1 ? "y" : "ies"}`
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
if (parts.length > 0) {
|
|
287
|
+
message += `
|
|
288
|
+
${parts.join(", ")}`;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
271
291
|
if (error.statusCode && !message.includes(`${error.statusCode}`)) {
|
|
272
292
|
message += `
|
|
273
293
|
HTTP Status: ${error.statusCode}`;
|
|
274
294
|
}
|
|
275
295
|
return message;
|
|
276
296
|
}
|
|
297
|
+
function formatDuration(ms) {
|
|
298
|
+
const seconds = Math.round(ms / 1e3);
|
|
299
|
+
if (seconds < 60) return `${seconds}s`;
|
|
300
|
+
const minutes = Math.round(seconds / 60);
|
|
301
|
+
if (minutes < 60) return `${minutes}m`;
|
|
302
|
+
const hours = Math.round(minutes / 60);
|
|
303
|
+
if (hours < 24) return `${hours}h`;
|
|
304
|
+
const days = Math.round(hours / 24);
|
|
305
|
+
return `${days}d`;
|
|
306
|
+
}
|
|
277
307
|
var ActionExecutionInputSchema = z.object({
|
|
278
308
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
279
309
|
/** @deprecated Use `connection` instead. */
|
|
@@ -615,6 +645,34 @@ function normalizeActionItem(action) {
|
|
|
615
645
|
type: "action"
|
|
616
646
|
};
|
|
617
647
|
}
|
|
648
|
+
function transformConnectionItem(item) {
|
|
649
|
+
const raw = item;
|
|
650
|
+
const publicId = raw.public_id;
|
|
651
|
+
const accountPublicId = raw.account_public_id;
|
|
652
|
+
const customuserPublicId = raw.customuser_public_id;
|
|
653
|
+
return {
|
|
654
|
+
id: String(publicId ?? item.id),
|
|
655
|
+
date: item.date,
|
|
656
|
+
account_id: String(accountPublicId ?? item.account_id),
|
|
657
|
+
is_invite_only: item.is_invite_only,
|
|
658
|
+
is_private: item.is_private,
|
|
659
|
+
shared_with_all: item.shared_with_all,
|
|
660
|
+
title: item.title,
|
|
661
|
+
lastchanged: item.lastchanged,
|
|
662
|
+
is_stale: item.is_stale,
|
|
663
|
+
is_shared: item.is_shared,
|
|
664
|
+
identifier: item.identifier,
|
|
665
|
+
groups: item.groups,
|
|
666
|
+
members: item.members,
|
|
667
|
+
permissions: item.permissions,
|
|
668
|
+
implementation_id: item.implementation_id,
|
|
669
|
+
profile_id: customuserPublicId ? String(customuserPublicId) : item.profile_id,
|
|
670
|
+
is_expired: item.is_expired,
|
|
671
|
+
expired_at: item.expired_at,
|
|
672
|
+
app_key: item.app_key,
|
|
673
|
+
app_version: item.app_version
|
|
674
|
+
};
|
|
675
|
+
}
|
|
618
676
|
function isSlug(slug) {
|
|
619
677
|
return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
620
678
|
}
|
|
@@ -1597,6 +1655,7 @@ z.object({
|
|
|
1597
1655
|
});
|
|
1598
1656
|
z.object({
|
|
1599
1657
|
id: z.number(),
|
|
1658
|
+
public_id: z.string().optional(),
|
|
1600
1659
|
code: z.string(),
|
|
1601
1660
|
user_id: z.number(),
|
|
1602
1661
|
auto_provisioned: z.boolean(),
|
|
@@ -2102,8 +2161,12 @@ function transformTableItem(apiItem) {
|
|
|
2102
2161
|
created_at: apiItem.created_at,
|
|
2103
2162
|
edited_at: apiItem.edited_at,
|
|
2104
2163
|
kind: apiItem.kind,
|
|
2105
|
-
|
|
2106
|
-
|
|
2164
|
+
account_id: String(
|
|
2165
|
+
apiItem.owner_account_public_id ?? apiItem.owner_account_id
|
|
2166
|
+
),
|
|
2167
|
+
profile_id: String(
|
|
2168
|
+
apiItem.owner_zapier_customuser_public_id ?? apiItem.owner_zapier_customuser_id
|
|
2169
|
+
),
|
|
2107
2170
|
parent_table_id: apiItem.parent_table_id ?? void 0
|
|
2108
2171
|
};
|
|
2109
2172
|
}
|
|
@@ -3319,7 +3382,10 @@ var listConnectionsPlugin = ({ context }) => {
|
|
|
3319
3382
|
authRequired: true
|
|
3320
3383
|
}
|
|
3321
3384
|
);
|
|
3322
|
-
return
|
|
3385
|
+
return {
|
|
3386
|
+
...response,
|
|
3387
|
+
data: response.data.map(transformConnectionItem)
|
|
3388
|
+
};
|
|
3323
3389
|
}
|
|
3324
3390
|
const methodName = stripPageSuffix(listConnectionsPage.name);
|
|
3325
3391
|
const listConnectionsDefinition = createPaginatedFunction(
|
|
@@ -3716,9 +3782,13 @@ var getConnectionPlugin = ({ context }) => {
|
|
|
3716
3782
|
if (!resolvedConnectionId) {
|
|
3717
3783
|
throw new Error("connection is required");
|
|
3718
3784
|
}
|
|
3719
|
-
|
|
3785
|
+
const response = await api.get(
|
|
3720
3786
|
`/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`
|
|
3721
3787
|
);
|
|
3788
|
+
return {
|
|
3789
|
+
...response,
|
|
3790
|
+
data: transformConnectionItem(response.data)
|
|
3791
|
+
};
|
|
3722
3792
|
}
|
|
3723
3793
|
const getConnectionDefinition = createFunction(
|
|
3724
3794
|
getConnection,
|
|
@@ -4678,7 +4748,7 @@ var getProfilePlugin = ({ context }) => {
|
|
|
4678
4748
|
);
|
|
4679
4749
|
return {
|
|
4680
4750
|
data: {
|
|
4681
|
-
id: String(profile.id),
|
|
4751
|
+
id: String(profile.public_id ?? profile.id),
|
|
4682
4752
|
first_name: profile.first_name,
|
|
4683
4753
|
last_name: profile.last_name,
|
|
4684
4754
|
full_name: `${profile.first_name} ${profile.last_name}`,
|
|
@@ -6095,8 +6165,10 @@ var TableApiItemSchema = z.object({
|
|
|
6095
6165
|
edited_at: z.string(),
|
|
6096
6166
|
kind: z.enum(["table", "virtual_table"]),
|
|
6097
6167
|
owner_account_id: z.number(),
|
|
6168
|
+
owner_account_public_id: z.string().optional(),
|
|
6098
6169
|
owner_user_id: z.number().nullable().optional(),
|
|
6099
6170
|
owner_zapier_customuser_id: z.number(),
|
|
6171
|
+
owner_zapier_customuser_public_id: z.string().optional(),
|
|
6100
6172
|
parent_table_id: z.string().nullable().optional()
|
|
6101
6173
|
});
|
|
6102
6174
|
var ListTablesApiResponseSchema = z.object({
|
|
@@ -6112,7 +6184,7 @@ var TableItemSchema = z.object({
|
|
|
6112
6184
|
created_at: z.string(),
|
|
6113
6185
|
edited_at: z.string(),
|
|
6114
6186
|
kind: z.enum(["table", "virtual_table"]),
|
|
6115
|
-
|
|
6187
|
+
account_id: z.string(),
|
|
6116
6188
|
profile_id: z.string(),
|
|
6117
6189
|
parent_table_id: z.string().optional()
|
|
6118
6190
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAK3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,CACb,OAAO,EAAE,kBAAkB,KACxB,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,aAAa,EAAE;gBACb,WAAW,EAAE,OAAO,wBAAwB,CAAC;aAC9C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,0BAA0B;AACrE,2BAA2B,CAgD5B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createFunction } from "../../utils/function-utils";
|
|
2
2
|
import { connectionIdGenericResolver } from "../../resolvers";
|
|
3
|
+
import { transformConnectionItem } from "../../utils/domain-utils";
|
|
3
4
|
import { ConnectionItemSchema } from "../../schemas/Connection";
|
|
4
5
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
5
6
|
import { GetConnectionParamSchema } from "./schemas";
|
|
@@ -10,7 +11,11 @@ export const getConnectionPlugin = ({ context }) => {
|
|
|
10
11
|
if (!resolvedConnectionId) {
|
|
11
12
|
throw new Error("connection is required");
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
const response = await api.get(`/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`);
|
|
15
|
+
return {
|
|
16
|
+
...response,
|
|
17
|
+
data: transformConnectionItem(response.data),
|
|
18
|
+
};
|
|
14
19
|
}
|
|
15
20
|
const getConnectionDefinition = createFunction(getConnection, GetConnectionParamSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getConnection.name));
|
|
16
21
|
return {
|
|
@@ -10,7 +10,7 @@ export const getProfilePlugin = ({ context }) => {
|
|
|
10
10
|
});
|
|
11
11
|
return {
|
|
12
12
|
data: {
|
|
13
|
-
id: String(profile.id),
|
|
13
|
+
id: String(profile.public_id ?? profile.id),
|
|
14
14
|
first_name: profile.first_name,
|
|
15
15
|
last_name: profile.last_name,
|
|
16
16
|
full_name: `${profile.first_name} ${profile.last_name}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;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AAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,GAAG,oBAAoB,GACtB,mBAAmB,GACnB,yBAAyB,CAAC,SAAS,CAAC,EACtC,6BAA6B,CA6I9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListConnectionsQuerySchema, } from "./schemas";
|
|
2
|
-
import { splitVersionedKey, resolveConnectionId, } from "../../utils/domain-utils";
|
|
2
|
+
import { splitVersionedKey, resolveConnectionId, transformConnectionItem, } from "../../utils/domain-utils";
|
|
3
3
|
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
4
4
|
import { DEFAULT_PAGE_SIZE } from "../../constants";
|
|
5
5
|
import { appKeyResolver } from "../../resolvers";
|
|
@@ -92,7 +92,10 @@ export const listConnectionsPlugin = ({ context }) => {
|
|
|
92
92
|
},
|
|
93
93
|
authRequired: true,
|
|
94
94
|
});
|
|
95
|
-
return
|
|
95
|
+
return {
|
|
96
|
+
...response,
|
|
97
|
+
data: response.data.map(transformConnectionItem),
|
|
98
|
+
};
|
|
96
99
|
}
|
|
97
100
|
const methodName = stripPageSuffix(listConnectionsPage.name);
|
|
98
101
|
const listConnectionsDefinition = createPaginatedFunction(listConnectionsPage, ListConnectionsQuerySchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
@@ -16,8 +16,10 @@ export declare const CreateTableApiResponseSchema: z.ZodObject<{
|
|
|
16
16
|
virtual_table: "virtual_table";
|
|
17
17
|
}>;
|
|
18
18
|
owner_account_id: z.ZodNumber;
|
|
19
|
+
owner_account_public_id: z.ZodOptional<z.ZodString>;
|
|
19
20
|
owner_user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
21
|
owner_zapier_customuser_id: z.ZodNumber;
|
|
22
|
+
owner_zapier_customuser_public_id: z.ZodOptional<z.ZodString>;
|
|
21
23
|
parent_table_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
24
|
}, z.core.$strip>;
|
|
23
25
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAExC,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/createTable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAExC,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;iBAEvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;iBAQJ,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,GACvE,eAAe,CAAC;AAGlB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;CACjB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1E"}
|
|
@@ -15,8 +15,10 @@ export declare const GetTableApiResponseSchema: z.ZodObject<{
|
|
|
15
15
|
virtual_table: "virtual_table";
|
|
16
16
|
}>;
|
|
17
17
|
owner_account_id: z.ZodNumber;
|
|
18
|
+
owner_account_public_id: z.ZodOptional<z.ZodString>;
|
|
18
19
|
owner_user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
20
|
owner_zapier_customuser_id: z.ZodNumber;
|
|
21
|
+
owner_zapier_customuser_public_id: z.ZodOptional<z.ZodString>;
|
|
20
22
|
parent_table_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
23
|
}, z.core.$strip>;
|
|
22
24
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/getTable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,E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AClC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;CACtE"}
|
|
@@ -12,8 +12,10 @@ export declare const TableApiItemSchema: z.ZodObject<{
|
|
|
12
12
|
virtual_table: "virtual_table";
|
|
13
13
|
}>;
|
|
14
14
|
owner_account_id: z.ZodNumber;
|
|
15
|
+
owner_account_public_id: z.ZodOptional<z.ZodString>;
|
|
15
16
|
owner_user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
16
17
|
owner_zapier_customuser_id: z.ZodNumber;
|
|
18
|
+
owner_zapier_customuser_public_id: z.ZodOptional<z.ZodString>;
|
|
17
19
|
parent_table_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
20
|
}, z.core.$strip>;
|
|
19
21
|
export type TableApiItem = z.infer<typeof TableApiItemSchema>;
|
|
@@ -29,8 +31,10 @@ export declare const ListTablesApiResponseSchema: z.ZodObject<{
|
|
|
29
31
|
virtual_table: "virtual_table";
|
|
30
32
|
}>;
|
|
31
33
|
owner_account_id: z.ZodNumber;
|
|
34
|
+
owner_account_public_id: z.ZodOptional<z.ZodString>;
|
|
32
35
|
owner_user_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
36
|
owner_zapier_customuser_id: z.ZodNumber;
|
|
37
|
+
owner_zapier_customuser_public_id: z.ZodOptional<z.ZodString>;
|
|
34
38
|
parent_table_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
39
|
}, z.core.$strip>>;
|
|
36
40
|
links: z.ZodOptional<z.ZodObject<{
|
|
@@ -48,7 +52,7 @@ export declare const TableItemSchema: z.ZodObject<{
|
|
|
48
52
|
table: "table";
|
|
49
53
|
virtual_table: "virtual_table";
|
|
50
54
|
}>;
|
|
51
|
-
|
|
55
|
+
account_id: z.ZodString;
|
|
52
56
|
profile_id: z.ZodString;
|
|
53
57
|
parent_table_id: z.ZodOptional<z.ZodString>;
|
|
54
58
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTables/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/tables/listTables/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;iBAa7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;iBAOtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,eAAe;;;;;;;;;;;;;iBAU1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;iBAwC0B,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,EACvC,UAAU,CACX,GAAG;IACF,wCAAwC;IACxC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC,UAAU,CAAC,CAAC;CAChE,CAAC;AAGF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,eAAe,GACvB,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,oBAAoB,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;CAChE"}
|
|
@@ -8,8 +8,10 @@ export const TableApiItemSchema = z.object({
|
|
|
8
8
|
edited_at: z.string(),
|
|
9
9
|
kind: z.enum(["table", "virtual_table"]),
|
|
10
10
|
owner_account_id: z.number(),
|
|
11
|
+
owner_account_public_id: z.string().optional(),
|
|
11
12
|
owner_user_id: z.number().nullable().optional(),
|
|
12
13
|
owner_zapier_customuser_id: z.number(),
|
|
14
|
+
owner_zapier_customuser_public_id: z.string().optional(),
|
|
13
15
|
parent_table_id: z.string().nullable().optional(),
|
|
14
16
|
});
|
|
15
17
|
export const ListTablesApiResponseSchema = z.object({
|
|
@@ -27,7 +29,7 @@ export const TableItemSchema = z.object({
|
|
|
27
29
|
created_at: z.string(),
|
|
28
30
|
edited_at: z.string(),
|
|
29
31
|
kind: z.enum(["table", "virtual_table"]),
|
|
30
|
-
|
|
32
|
+
account_id: z.string(),
|
|
31
33
|
profile_id: z.string(),
|
|
32
34
|
parent_table_id: z.string().optional(),
|
|
33
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/tables/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,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IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAkF9B"}
|
|
@@ -34,8 +34,9 @@ export function transformTableItem(apiItem) {
|
|
|
34
34
|
created_at: apiItem.created_at,
|
|
35
35
|
edited_at: apiItem.edited_at,
|
|
36
36
|
kind: apiItem.kind,
|
|
37
|
-
|
|
38
|
-
profile_id: String(apiItem.
|
|
37
|
+
account_id: String(apiItem.owner_account_public_id ?? apiItem.owner_account_id),
|
|
38
|
+
profile_id: String(apiItem.owner_zapier_customuser_public_id ??
|
|
39
|
+
apiItem.owner_zapier_customuser_id),
|
|
39
40
|
parent_table_id: apiItem.parent_table_id ?? undefined,
|
|
40
41
|
};
|
|
41
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,8BAAsB,WAAY,SAAQ,KAAK;IAC7C,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,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AoB,SAAQ,WAAW;IAClD,QAAQ,CAAC,IAAI,yBAAyB;IACtC,QAAQ,CAAC,IAAI,EAAG,wBAAwB,CAAU;gBAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAGxD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,0BAA0B;IACvC,QAAQ,CAAC,IAAI,EAAG,yBAAyB,CAAU;IAC5C,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAAY,GAAG;QACtB,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;KACb;CAMT;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,IAAI,EAAG,oBAAoB,CAAU;gBAElC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAGxD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAkF7D"}
|
package/dist/types/errors.js
CHANGED
|
@@ -213,9 +213,39 @@ export function formatErrorMessage(error) {
|
|
|
213
213
|
"\n\nBuild errors:\n" +
|
|
214
214
|
error.buildErrors.map((err) => ` • ${err}`).join("\n");
|
|
215
215
|
}
|
|
216
|
+
if (error instanceof ZapierRateLimitError) {
|
|
217
|
+
const { limit, remaining, retryAfterMs } = error.rateLimit;
|
|
218
|
+
const parts = [];
|
|
219
|
+
if (limit !== undefined) {
|
|
220
|
+
const used = remaining !== undefined ? limit - remaining : limit;
|
|
221
|
+
parts.push(`${used}/${limit} used`);
|
|
222
|
+
}
|
|
223
|
+
if (retryAfterMs !== undefined && retryAfterMs > 0) {
|
|
224
|
+
parts.push(`retry in ${formatDuration(retryAfterMs)}`);
|
|
225
|
+
}
|
|
226
|
+
if (error.retries > 0) {
|
|
227
|
+
parts.push(`after ${error.retries} retr${error.retries === 1 ? "y" : "ies"}`);
|
|
228
|
+
}
|
|
229
|
+
if (parts.length > 0) {
|
|
230
|
+
message += `\n${parts.join(", ")}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
216
233
|
// Add status code if available and not already obvious from the message
|
|
217
234
|
if (error.statusCode && !message.includes(`${error.statusCode}`)) {
|
|
218
235
|
message += `\nHTTP Status: ${error.statusCode}`;
|
|
219
236
|
}
|
|
220
237
|
return message;
|
|
221
238
|
}
|
|
239
|
+
function formatDuration(ms) {
|
|
240
|
+
const seconds = Math.round(ms / 1000);
|
|
241
|
+
if (seconds < 60)
|
|
242
|
+
return `${seconds}s`;
|
|
243
|
+
const minutes = Math.round(seconds / 60);
|
|
244
|
+
if (minutes < 60)
|
|
245
|
+
return `${minutes}m`;
|
|
246
|
+
const hours = Math.round(minutes / 60);
|
|
247
|
+
if (hours < 24)
|
|
248
|
+
return `${hours}h`;
|
|
249
|
+
const days = Math.round(hours / 24);
|
|
250
|
+
return `${days}d`;
|
|
251
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { Action, ImplementationMeta } from "../api/types";
|
|
5
5
|
import type { ConnectionEntry } from "../types/connections";
|
|
6
|
-
import type { ActionItem, AppItem } from "../types/domain";
|
|
6
|
+
import type { ActionItem, AppItem, ConnectionItem } from "../types/domain";
|
|
7
7
|
/**
|
|
8
8
|
* Checks if a string value looks like a direct connection ID rather than a named alias.
|
|
9
9
|
* Returns true for numeric strings and UUIDs.
|
|
@@ -42,6 +42,12 @@ export declare function splitVersionedKey(versionedKey: string): [string, string
|
|
|
42
42
|
*/
|
|
43
43
|
export declare function normalizeImplementationMetaToAppItem(implementationMeta: ImplementationMeta): AppItem;
|
|
44
44
|
export declare function normalizeActionItem(action: Action): ActionItem;
|
|
45
|
+
/**
|
|
46
|
+
* Prefer public IDs over numeric IDs in a connection item.
|
|
47
|
+
* The API returns extra public_id, account_public_id, and customuser_public_id
|
|
48
|
+
* fields alongside the stringified numeric IDs. This function swaps them in.
|
|
49
|
+
*/
|
|
50
|
+
export declare function transformConnectionItem(item: ConnectionItem): ConnectionItem;
|
|
45
51
|
/**
|
|
46
52
|
* Groups app keys by their type based on format patterns
|
|
47
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-utils.d.ts","sourceRoot":"","sources":["../../src/utils/domain-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"domain-utils.d.ts","sourceRoot":"","sources":["../../src/utils/domain-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAM3E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,YAAY,EACZ,UAAU,E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,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY1D;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAI9C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAkBvD;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,kBAAkB,CAElC;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAEzE"}
|
|
@@ -102,6 +102,41 @@ export function normalizeActionItem(action) {
|
|
|
102
102
|
type: "action",
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Prefer public IDs over numeric IDs in a connection item.
|
|
107
|
+
* The API returns extra public_id, account_public_id, and customuser_public_id
|
|
108
|
+
* fields alongside the stringified numeric IDs. This function swaps them in.
|
|
109
|
+
*/
|
|
110
|
+
export function transformConnectionItem(item) {
|
|
111
|
+
const raw = item;
|
|
112
|
+
const publicId = raw.public_id;
|
|
113
|
+
const accountPublicId = raw.account_public_id;
|
|
114
|
+
const customuserPublicId = raw.customuser_public_id;
|
|
115
|
+
return {
|
|
116
|
+
id: String(publicId ?? item.id),
|
|
117
|
+
date: item.date,
|
|
118
|
+
account_id: String(accountPublicId ?? item.account_id),
|
|
119
|
+
is_invite_only: item.is_invite_only,
|
|
120
|
+
is_private: item.is_private,
|
|
121
|
+
shared_with_all: item.shared_with_all,
|
|
122
|
+
title: item.title,
|
|
123
|
+
lastchanged: item.lastchanged,
|
|
124
|
+
is_stale: item.is_stale,
|
|
125
|
+
is_shared: item.is_shared,
|
|
126
|
+
identifier: item.identifier,
|
|
127
|
+
groups: item.groups,
|
|
128
|
+
members: item.members,
|
|
129
|
+
permissions: item.permissions,
|
|
130
|
+
implementation_id: item.implementation_id,
|
|
131
|
+
profile_id: customuserPublicId
|
|
132
|
+
? String(customuserPublicId)
|
|
133
|
+
: item.profile_id,
|
|
134
|
+
is_expired: item.is_expired,
|
|
135
|
+
expired_at: item.expired_at,
|
|
136
|
+
app_key: item.app_key,
|
|
137
|
+
app_version: item.app_version,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
105
140
|
/**
|
|
106
141
|
* Groups app keys by their type based on format patterns
|
|
107
142
|
*
|