@zapier/zapier-sdk 0.17.0 → 0.18.0
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 +6 -0
- package/README.md +92 -92
- package/dist/api/schemas.d.ts +1 -1
- package/dist/api/schemas.js +1 -1
- package/dist/index.cjs +81 -45
- package/dist/index.d.mts +58 -100
- package/dist/index.mjs +81 -45
- package/dist/plugins/apps/index.js +2 -2
- package/dist/plugins/apps/schemas.d.ts +4 -3
- package/dist/plugins/apps/schemas.d.ts.map +1 -1
- package/dist/plugins/apps/schemas.js +3 -2
- package/dist/plugins/fetch/index.d.ts +2 -2
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/schemas.d.ts +1 -1
- package/dist/plugins/fetch/schemas.d.ts.map +1 -1
- package/dist/plugins/fetch/schemas.js +2 -4
- package/dist/plugins/findFirstAuthentication/index.test.js +4 -4
- package/dist/plugins/findUniqueAuthentication/index.test.js +4 -4
- package/dist/plugins/getAuthentication/index.js +1 -1
- package/dist/plugins/getAuthentication/index.test.js +9 -4
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +1 -1
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +7 -4
- package/dist/plugins/listAuthentications/index.test.js +9 -9
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +1 -1
- package/dist/plugins/listInputFields/schemas.d.ts +1 -1
- package/dist/plugins/manifest/schemas.d.ts +2 -2
- package/dist/plugins/manifest/schemas.d.ts.map +1 -1
- package/dist/plugins/manifest/schemas.js +2 -5
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +2 -1
- package/dist/plugins/request/schemas.d.ts +2 -2
- package/dist/plugins/request/schemas.d.ts.map +1 -1
- package/dist/plugins/request/schemas.js +2 -5
- package/dist/plugins/runAction/schemas.d.ts +1 -1
- package/dist/resolvers/inputFieldKey.d.ts +1 -1
- package/dist/resolvers/inputFieldKey.d.ts.map +1 -1
- package/dist/resolvers/inputs.d.ts +1 -1
- package/dist/resolvers/inputs.d.ts.map +1 -1
- package/dist/schemas/Auth.d.ts +6 -6
- package/dist/schemas/Auth.d.ts.map +1 -1
- package/dist/schemas/Auth.js +3 -1
- package/dist/schemas/UserProfile.d.ts +2 -44
- package/dist/schemas/UserProfile.d.ts.map +1 -1
- package/dist/schemas/UserProfile.js +10 -21
- package/dist/services/implementations.d.ts +2 -2
- package/dist/services/implementations.d.ts.map +1 -1
- package/dist/services/implementations.js +3 -2
- package/dist/temporary-internal-core/handlers/getAuthentication.test.js +6 -6
- package/dist/temporary-internal-core/schemas/authentications/index.d.ts +7 -7
- package/dist/temporary-internal-core/schemas/authentications/index.d.ts.map +1 -1
- package/dist/temporary-internal-core/schemas/authentications/index.js +5 -4
- package/dist/temporary-internal-core/utils/transformations.d.ts.map +1 -1
- package/dist/temporary-internal-core/utils/transformations.js +4 -2
- package/dist/types/properties.d.ts +1 -1
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/properties.js +1 -2
- package/dist/utils/domain-utils.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +4 -2
- package/dist/utils/id-utils.d.ts +13 -0
- package/dist/utils/id-utils.d.ts.map +1 -0
- package/dist/utils/id-utils.js +22 -0
- package/dist/utils/id-utils.test.d.ts +2 -0
- package/dist/utils/id-utils.test.d.ts.map +1 -0
- package/dist/utils/id-utils.test.js +22 -0
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ export declare const ListInputFieldChoicesSchema: z.ZodObject<{
|
|
|
24
24
|
}>;
|
|
25
25
|
actionKey: z.ZodString;
|
|
26
26
|
inputFieldKey: z.ZodString;
|
|
27
|
-
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber
|
|
27
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
28
28
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
29
29
|
page: z.ZodOptional<z.ZodNumber>;
|
|
30
30
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -17,7 +17,7 @@ export declare const ListInputFieldsSchema: z.ZodObject<{
|
|
|
17
17
|
write: "write";
|
|
18
18
|
}>;
|
|
19
19
|
actionKey: z.ZodString;
|
|
20
|
-
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber
|
|
20
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
21
21
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
22
22
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
23
23
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -16,7 +16,7 @@ export declare const ActionEntrySchema: z.ZodObject<{
|
|
|
16
16
|
appKey: z.ZodString;
|
|
17
17
|
actionKey: z.ZodString;
|
|
18
18
|
actionType: z.ZodString;
|
|
19
|
-
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber
|
|
19
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
20
20
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
21
|
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
22
22
|
createdAt: z.ZodString;
|
|
@@ -41,7 +41,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
41
41
|
appKey: z.ZodString;
|
|
42
42
|
actionKey: z.ZodString;
|
|
43
43
|
actionType: z.ZodString;
|
|
44
|
-
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber
|
|
44
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
45
45
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
46
|
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
47
47
|
createdAt: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/manifest/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/manifest/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,eAAO,MAAM,mBAAmB,EAAG,WAAoB,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CACzC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;iBAiB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,EAC5B,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;iBAkB8C,CAAC;AAE1E,eAAO,MAAM,2BAA2B;;;;;;iBAYtC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { AuthenticationIdPropertySchema } from "../../types/properties";
|
|
2
3
|
export const DEFAULT_CONFIG_PATH = ".zapierrc";
|
|
3
4
|
/**
|
|
4
5
|
* Action entry for storing saved action configurations
|
|
@@ -10,11 +11,7 @@ export const ActionEntrySchema = z.object({
|
|
|
10
11
|
actionType: z
|
|
11
12
|
.string()
|
|
12
13
|
.describe("Action type (e.g., 'read', 'write', 'search')"),
|
|
13
|
-
authenticationId:
|
|
14
|
-
.number()
|
|
15
|
-
.nullable()
|
|
16
|
-
.optional()
|
|
17
|
-
.describe("Authentication ID used"),
|
|
14
|
+
authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
|
|
18
15
|
inputs: z
|
|
19
16
|
.record(z.string(), z.unknown())
|
|
20
17
|
.optional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAoB7D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,WAAW,EAAE,OAAO,kBAAkB,CAAC;aACxC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAChC,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,0BAA0B;AACrE,qBAAqB,CA2FtB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RelayRequestSchema } from "./schemas";
|
|
2
2
|
import { createFunction } from "../../utils/function-utils";
|
|
3
3
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
4
|
+
import { coerceToNumericId } from "../../utils/id-utils";
|
|
4
5
|
/**
|
|
5
6
|
* Transforms full URLs into Relay format: /relay/{domain}/{path}
|
|
6
7
|
*
|
|
@@ -44,7 +45,7 @@ export const requestPlugin = ({ context }) => {
|
|
|
44
45
|
}
|
|
45
46
|
// Add Relay-specific headers
|
|
46
47
|
if (authenticationId) {
|
|
47
|
-
headers["X-Relay-Authentication-Id"] = authenticationId.toString();
|
|
48
|
+
headers["X-Relay-Authentication-Id"] = coerceToNumericId("authenticationId", authenticationId).toString();
|
|
48
49
|
}
|
|
49
50
|
if (callbackUrl) {
|
|
50
51
|
headers["X-Relay-Callback-Url"] = callbackUrl;
|
|
@@ -12,7 +12,7 @@ export declare const RelayRequestSchema: z.ZodObject<{
|
|
|
12
12
|
OPTIONS: "OPTIONS";
|
|
13
13
|
}>>;
|
|
14
14
|
body: z.ZodOptional<z.ZodAny>;
|
|
15
|
-
authenticationId: z.ZodOptional<z.ZodNumber
|
|
15
|
+
authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
16
16
|
callbackUrl: z.ZodOptional<z.ZodString>;
|
|
17
17
|
authenticationTemplate: z.ZodOptional<z.ZodString>;
|
|
18
18
|
headers: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodCustom<Headers, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>]>>;
|
|
@@ -38,7 +38,7 @@ export declare const RelayFetchSchema: z.ZodObject<{
|
|
|
38
38
|
OPTIONS: "OPTIONS";
|
|
39
39
|
}>>;
|
|
40
40
|
body: z.ZodOptional<z.ZodAny>;
|
|
41
|
-
authenticationId: z.ZodOptional<z.ZodNumber
|
|
41
|
+
authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
42
42
|
callbackUrl: z.ZodOptional<z.ZodString>;
|
|
43
43
|
authenticationTemplate: z.ZodOptional<z.ZodString>;
|
|
44
44
|
headers: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodCustom<Headers, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;iBAoC+C,CAAC;AAG/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAGrE,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9D;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;iBAAqB,CAAC;AACnD,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACpD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC1D"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { TelemetryMarkerSchema } from "../../utils/function-utils";
|
|
3
|
+
import { AuthenticationIdPropertySchema } from "../../types/properties";
|
|
3
4
|
// Pure Zod schema for the request function
|
|
4
5
|
export const RelayRequestSchema = z
|
|
5
6
|
.object({
|
|
@@ -12,11 +13,7 @@ export const RelayRequestSchema = z
|
|
|
12
13
|
.optional()
|
|
13
14
|
.describe("HTTP method"),
|
|
14
15
|
body: z.any().optional().describe("Request body as a string"),
|
|
15
|
-
authenticationId:
|
|
16
|
-
.number()
|
|
17
|
-
.int()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe("Zapier authentication ID to use for the request"),
|
|
16
|
+
authenticationId: AuthenticationIdPropertySchema.optional(),
|
|
20
17
|
callbackUrl: z
|
|
21
18
|
.string()
|
|
22
19
|
.url()
|
|
@@ -16,7 +16,7 @@ export declare const RunActionSchema: z.ZodObject<{
|
|
|
16
16
|
write: "write";
|
|
17
17
|
}>;
|
|
18
18
|
actionKey: z.ZodString;
|
|
19
|
-
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber
|
|
19
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
20
20
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
21
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
22
22
|
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -5,7 +5,7 @@ export declare const inputFieldKeyResolver: DynamicResolver<InputFieldItem, {
|
|
|
5
5
|
appKey: string;
|
|
6
6
|
actionKey: string;
|
|
7
7
|
actionType: ActionTypeProperty;
|
|
8
|
-
authenticationId: number;
|
|
8
|
+
authenticationId: string | number;
|
|
9
9
|
inputs?: Record<string, unknown>;
|
|
10
10
|
}>;
|
|
11
11
|
//# sourceMappingURL=inputFieldKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputFieldKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputFieldKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAiC9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,cAAc,EACd;IACE,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"inputFieldKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputFieldKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAiC9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,cAAc,EACd;IACE,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CA0BF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAuBrD,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,CACL,GAAG,EAAE,GAAG,EACR,cAAc,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAuBrD,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,CACL,GAAG,EAAE,GAAG,EACR,cAAc,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;QAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,KACE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAa5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,cAcvC,CAAC"}
|
package/dist/schemas/Auth.d.ts
CHANGED
|
@@ -2,10 +2,8 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const AuthenticationItemSchema: z.ZodObject<{
|
|
3
3
|
url: z.ZodOptional<z.ZodString>;
|
|
4
4
|
members: z.ZodOptional<z.ZodString>;
|
|
5
|
-
account_id: z.ZodNumber;
|
|
6
5
|
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
6
|
date: z.ZodString;
|
|
8
|
-
id: z.ZodNumber;
|
|
9
7
|
lastchanged: z.ZodOptional<z.ZodString>;
|
|
10
8
|
destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
9
|
is_invite_only: z.ZodBoolean;
|
|
@@ -18,20 +16,20 @@ export declare const AuthenticationItemSchema: z.ZodObject<{
|
|
|
18
16
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
17
|
groups: z.ZodOptional<z.ZodString>;
|
|
20
18
|
permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
account_id: z.ZodString;
|
|
21
21
|
implementation_id: z.ZodOptional<z.ZodString>;
|
|
22
22
|
is_expired: z.ZodOptional<z.ZodString>;
|
|
23
23
|
expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
24
|
app_key: z.ZodOptional<z.ZodString>;
|
|
25
25
|
app_version: z.ZodOptional<z.ZodString>;
|
|
26
|
-
profile_id: z.ZodOptional<z.
|
|
26
|
+
profile_id: z.ZodOptional<z.ZodString>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
export declare const AuthItemSchema: z.ZodObject<{
|
|
29
29
|
url: z.ZodOptional<z.ZodString>;
|
|
30
30
|
members: z.ZodOptional<z.ZodString>;
|
|
31
|
-
account_id: z.ZodNumber;
|
|
32
31
|
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
32
|
date: z.ZodString;
|
|
34
|
-
id: z.ZodNumber;
|
|
35
33
|
lastchanged: z.ZodOptional<z.ZodString>;
|
|
36
34
|
destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
35
|
is_invite_only: z.ZodBoolean;
|
|
@@ -44,12 +42,14 @@ export declare const AuthItemSchema: z.ZodObject<{
|
|
|
44
42
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
43
|
groups: z.ZodOptional<z.ZodString>;
|
|
46
44
|
permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
account_id: z.ZodString;
|
|
47
47
|
implementation_id: z.ZodOptional<z.ZodString>;
|
|
48
48
|
is_expired: z.ZodOptional<z.ZodString>;
|
|
49
49
|
expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
50
|
app_key: z.ZodOptional<z.ZodString>;
|
|
51
51
|
app_version: z.ZodOptional<z.ZodString>;
|
|
52
|
-
profile_id: z.ZodOptional<z.
|
|
52
|
+
profile_id: z.ZodOptional<z.ZodString>;
|
|
53
53
|
}, z.core.$strip>;
|
|
54
54
|
export type AuthItem = z.infer<typeof AuthItemSchema>;
|
|
55
55
|
//# sourceMappingURL=Auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.d.ts","sourceRoot":"","sources":["../../src/schemas/Auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Auth.d.ts","sourceRoot":"","sources":["../../src/schemas/Auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;iBA2CpC,CAAC;AAGF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2B,CAAC;AAMvD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
package/dist/schemas/Auth.js
CHANGED
|
@@ -5,12 +5,14 @@ import { AuthenticationSchema } from "../api/schemas";
|
|
|
5
5
|
// Authentication Item Schema (extends API schema with computed fields and formatting)
|
|
6
6
|
// ============================================================================
|
|
7
7
|
export const AuthenticationItemSchema = withFormatter(AuthenticationSchema.omit({ selected_api: true, customuser_id: true }).extend({
|
|
8
|
+
id: z.string(), // Converted from number
|
|
9
|
+
account_id: z.string(), // Converted from number
|
|
8
10
|
implementation_id: z.string().optional(), // Renamed from selected_api
|
|
9
11
|
is_expired: z.string().optional(), // Mapped from is_stale
|
|
10
12
|
expired_at: z.string().nullable().optional(), // Mapped from marked_stale_at
|
|
11
13
|
app_key: z.string().optional(), // App key from implementations endpoint
|
|
12
14
|
app_version: z.string().optional(), // Version extracted from implementation_id
|
|
13
|
-
profile_id: z.
|
|
15
|
+
profile_id: z.string().optional(), // Mapped from customuser_id, converted from number
|
|
14
16
|
}), {
|
|
15
17
|
format: (item) => {
|
|
16
18
|
const details = [];
|
|
@@ -1,55 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export { FormattedItem, FormatMetadata } from "../utils/schema-utils";
|
|
3
3
|
export declare const UserProfileItemSchema: z.ZodObject<{
|
|
4
|
-
|
|
5
|
-
id: z.ZodNumber;
|
|
6
|
-
auto_provisioned: z.ZodBoolean;
|
|
4
|
+
id: z.ZodString;
|
|
7
5
|
first_name: z.ZodString;
|
|
8
6
|
last_name: z.ZodString;
|
|
9
|
-
|
|
10
|
-
personas: z.ZodString;
|
|
11
|
-
user_generated_personas: z.ZodString;
|
|
12
|
-
last_login: z.ZodString;
|
|
7
|
+
full_name: z.ZodString;
|
|
13
8
|
email: z.ZodString;
|
|
14
|
-
email_hash: z.ZodString;
|
|
15
9
|
email_confirmed: z.ZodBoolean;
|
|
16
10
|
timezone: z.ZodString;
|
|
17
|
-
photo_url: z.ZodString;
|
|
18
|
-
has_seen_notifications: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodBoolean>>;
|
|
19
|
-
signup: z.ZodString;
|
|
20
|
-
since_signup: z.ZodString;
|
|
21
|
-
has_activated: z.ZodBoolean;
|
|
22
|
-
enable_gz_creator: z.ZodBoolean;
|
|
23
|
-
should_see_nps_survey: z.ZodBoolean;
|
|
24
|
-
is_developer: z.ZodBoolean;
|
|
25
|
-
is_expert: z.ZodBoolean;
|
|
26
|
-
tos_agreement: z.ZodBoolean;
|
|
27
|
-
should_renew_tos: z.ZodBoolean;
|
|
28
|
-
is_gdpr_consented: z.ZodBoolean;
|
|
29
|
-
disable_ssl_check: z.ZodBoolean;
|
|
30
|
-
identity: z.ZodNumber;
|
|
31
|
-
summary_schedule: z.ZodString;
|
|
32
|
-
alert_triggers: z.ZodString;
|
|
33
|
-
alert_actions: z.ZodString;
|
|
34
|
-
is_staff: z.ZodBoolean;
|
|
35
|
-
is_zt_reviewer: z.ZodBoolean;
|
|
36
|
-
is_high_value: z.ZodBoolean;
|
|
37
|
-
is_temporary: z.ZodBoolean;
|
|
38
|
-
banner_message: z.ZodString;
|
|
39
|
-
enable_totp_2fa: z.ZodBoolean;
|
|
40
|
-
viewed_help: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
41
|
-
show_editor_migration_mesaging: z.ZodBoolean;
|
|
42
|
-
switches: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
43
|
-
organizations: z.ZodArray<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
44
|
-
primary_organization: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
45
|
-
has_active_zaps: z.ZodBoolean;
|
|
46
|
-
has_google_sso: z.ZodBoolean;
|
|
47
|
-
auth_realm: z.ZodString;
|
|
48
|
-
roles: z.ZodArray<z.ZodObject<{
|
|
49
|
-
account_id: z.ZodNumber;
|
|
50
|
-
role: z.ZodString;
|
|
51
|
-
}, z.core.$strip>>;
|
|
52
|
-
full_name: z.ZodString;
|
|
53
11
|
}, z.core.$strip>;
|
|
54
12
|
export type UserProfileItem = z.infer<typeof UserProfileItemSchema>;
|
|
55
13
|
//# sourceMappingURL=UserProfile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfile.d.ts","sourceRoot":"","sources":["../../src/schemas/UserProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"UserProfile.d.ts","sourceRoot":"","sources":["../../src/schemas/UserProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,qBAAqB;;;;;;;;iBA+BjC,CAAC;AAMF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { withFormatter } from "../utils/schema-utils";
|
|
3
|
-
import { UserProfileSchema } from "../api/schemas";
|
|
4
3
|
// ============================================================================
|
|
5
|
-
// User Profile Item Schema
|
|
4
|
+
// User Profile Item Schema
|
|
6
5
|
// ============================================================================
|
|
7
|
-
export const UserProfileItemSchema = withFormatter(
|
|
8
|
-
|
|
6
|
+
export const UserProfileItemSchema = withFormatter(z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
first_name: z.string(),
|
|
9
|
+
last_name: z.string(),
|
|
10
|
+
full_name: z.string(),
|
|
11
|
+
email: z.string(),
|
|
12
|
+
email_confirmed: z.boolean(),
|
|
13
|
+
timezone: z.string(),
|
|
9
14
|
}), {
|
|
10
15
|
format: (item) => {
|
|
11
16
|
const details = [];
|
|
12
|
-
if (item == null ||
|
|
13
|
-
typeof item !== "object" ||
|
|
14
|
-
!("full_name" in item) ||
|
|
15
|
-
!("username" in item)) {
|
|
16
|
-
return {
|
|
17
|
-
title: "User Profile",
|
|
18
|
-
subtitle: "Malformatted result item",
|
|
19
|
-
details: [],
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
17
|
if ("email" in item) {
|
|
23
18
|
details.push({ text: item.email, style: "dim" });
|
|
24
19
|
}
|
|
@@ -28,15 +23,9 @@ export const UserProfileItemSchema = withFormatter(UserProfileSchema.omit({ user
|
|
|
28
23
|
style: "accent",
|
|
29
24
|
});
|
|
30
25
|
}
|
|
31
|
-
if ("since_signup" in item && item.since_signup) {
|
|
32
|
-
details.push({
|
|
33
|
-
text: `Member since: ${item.since_signup}`,
|
|
34
|
-
style: "dim",
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
26
|
return {
|
|
38
27
|
title: item.full_name,
|
|
39
|
-
id: item.id
|
|
28
|
+
id: item.id,
|
|
40
29
|
details,
|
|
41
30
|
};
|
|
42
31
|
},
|
|
@@ -32,7 +32,7 @@ export declare function fetchImplementationNeeds({ api, selectedApi, action, act
|
|
|
32
32
|
selectedApi: string;
|
|
33
33
|
action: string;
|
|
34
34
|
actionType: string;
|
|
35
|
-
authenticationId: number | null;
|
|
35
|
+
authenticationId: string | number | null;
|
|
36
36
|
inputs?: Record<string, unknown>;
|
|
37
37
|
}): Promise<NeedsResponse>;
|
|
38
38
|
/**
|
|
@@ -56,7 +56,7 @@ export declare function fetchImplementationChoices({ api, actionId, inputFieldId
|
|
|
56
56
|
api: ApiClient;
|
|
57
57
|
actionId: string;
|
|
58
58
|
inputFieldId: string;
|
|
59
|
-
authenticationId: number | null;
|
|
59
|
+
authenticationId: string | number | null;
|
|
60
60
|
inputs?: Record<string, unknown>;
|
|
61
61
|
page: number;
|
|
62
62
|
}): Promise<NeedChoicesResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementations.d.ts","sourceRoot":"","sources":["../../src/services/implementations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAEV,aAAa,EAEb,mBAAmB,EACpB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"implementations.d.ts","sourceRoot":"","sources":["../../src/services/implementations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAEV,aAAa,EAEb,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,GAAG,EACH,WAAW,EACX,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,GACP,EAAE;IACD,GAAG,EAAE,SAAS,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GAAG,OAAO,CAAC,aAAa,CAAC,CA4BzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,EAC/C,GAAG,EACH,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,IAAI,GACL,EAAE;IACD,GAAG,EAAE,SAAS,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA4B/B"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* separation between the generic HTTP client layer and business logic.
|
|
10
10
|
*/
|
|
11
11
|
import { ZapierApiError } from "../types/errors";
|
|
12
|
+
import { coerceToNumericId } from "../utils/id-utils";
|
|
12
13
|
/**
|
|
13
14
|
* Fetches implementation needs (input fields) for a specific action.
|
|
14
15
|
*
|
|
@@ -35,7 +36,7 @@ export async function fetchImplementationNeeds({ api, selectedApi, action, actio
|
|
|
35
36
|
};
|
|
36
37
|
// Only include authentication_id if it's not null (skip authentication when null)
|
|
37
38
|
if (authenticationId !== null) {
|
|
38
|
-
request.authentication_id = authenticationId;
|
|
39
|
+
request.authentication_id = coerceToNumericId("authentication_id", authenticationId);
|
|
39
40
|
}
|
|
40
41
|
const response = await api.post("/zapier/api/v4/implementations/needs/", request);
|
|
41
42
|
if (!response.success) {
|
|
@@ -69,7 +70,7 @@ export async function fetchImplementationChoices({ api, actionId, inputFieldId,
|
|
|
69
70
|
};
|
|
70
71
|
// Only include authentication_id if it's not null (skip authentication when null)
|
|
71
72
|
if (authenticationId !== null) {
|
|
72
|
-
request.authentication_id = authenticationId;
|
|
73
|
+
request.authentication_id = coerceToNumericId("authentication_id", authenticationId);
|
|
73
74
|
}
|
|
74
75
|
const response = await api.post("/zapier/api/v4/implementations/choices/", request);
|
|
75
76
|
if (!response.success) {
|
|
@@ -87,9 +87,9 @@ describe("handleGetAuthentication", () => {
|
|
|
87
87
|
};
|
|
88
88
|
const result = await handleGetAuthentication({ request, deps });
|
|
89
89
|
expect(result.data).toEqual({
|
|
90
|
-
id: 123,
|
|
90
|
+
id: "123",
|
|
91
91
|
date: "2021-01-01",
|
|
92
|
-
account_id: 456,
|
|
92
|
+
account_id: "456",
|
|
93
93
|
implementation_id: "SlackCLIAPI@1.21.1",
|
|
94
94
|
is_invite_only: false,
|
|
95
95
|
is_private: false,
|
|
@@ -221,12 +221,12 @@ describe("handleGetAuthentication", () => {
|
|
|
221
221
|
};
|
|
222
222
|
const result = await handleGetAuthentication({ request, deps });
|
|
223
223
|
const auth = result.data;
|
|
224
|
-
// Verify original fields are preserved
|
|
225
|
-
expect(auth.id).toBe(123);
|
|
224
|
+
// Verify original fields are preserved (IDs converted to strings)
|
|
225
|
+
expect(auth.id).toBe("123");
|
|
226
226
|
expect(auth.date).toBe("2021-01-01");
|
|
227
227
|
expect(auth.lastchanged).toBe("2021-01-02");
|
|
228
|
-
expect(auth.account_id).toBe(456);
|
|
229
|
-
expect(auth.profile_id).toBe(789);
|
|
228
|
+
expect(auth.account_id).toBe("456");
|
|
229
|
+
expect(auth.profile_id).toBe("789");
|
|
230
230
|
expect(auth.implementation_id).toBe("SlackCLIAPI@1.21.1");
|
|
231
231
|
expect(auth.destination_selected_api).toBe("SlackDestAPI@1.0.0");
|
|
232
232
|
expect(auth.is_invite_only).toBe(true);
|
|
@@ -68,10 +68,8 @@ export type Authentication = z.infer<typeof AuthenticationSchema>;
|
|
|
68
68
|
export declare const AuthenticationItemSchema: z.ZodObject<{
|
|
69
69
|
url: z.ZodOptional<z.ZodString>;
|
|
70
70
|
members: z.ZodOptional<z.ZodString>;
|
|
71
|
-
account_id: z.ZodNumber;
|
|
72
71
|
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
72
|
date: z.ZodString;
|
|
74
|
-
id: z.ZodNumber;
|
|
75
73
|
lastchanged: z.ZodOptional<z.ZodString>;
|
|
76
74
|
destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
75
|
is_invite_only: z.ZodBoolean;
|
|
@@ -84,8 +82,10 @@ export declare const AuthenticationItemSchema: z.ZodObject<{
|
|
|
84
82
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
83
|
groups: z.ZodOptional<z.ZodString>;
|
|
86
84
|
permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
account_id: z.ZodString;
|
|
87
87
|
implementation_id: z.ZodOptional<z.ZodString>;
|
|
88
|
-
profile_id: z.ZodOptional<z.
|
|
88
|
+
profile_id: z.ZodOptional<z.ZodString>;
|
|
89
89
|
is_expired: z.ZodOptional<z.ZodString>;
|
|
90
90
|
expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
91
|
app_key: z.ZodOptional<z.ZodString>;
|
|
@@ -98,7 +98,7 @@ export type AuthenticationItem = z.infer<typeof AuthenticationItemSchema>;
|
|
|
98
98
|
* This is the user-facing schema that the SDK plugin accepts.
|
|
99
99
|
*/
|
|
100
100
|
export declare const GetAuthenticationOptionsSchema: z.ZodObject<{
|
|
101
|
-
authenticationId: z.ZodNumber
|
|
101
|
+
authenticationId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
102
102
|
}, z.core.$strip>;
|
|
103
103
|
export type GetAuthenticationOptions = z.infer<typeof GetAuthenticationOptionsSchema>;
|
|
104
104
|
/**
|
|
@@ -122,10 +122,8 @@ export declare const GetAuthenticationResponseSchema: z.ZodObject<{
|
|
|
122
122
|
data: z.ZodLazy<z.ZodObject<{
|
|
123
123
|
url: z.ZodOptional<z.ZodString>;
|
|
124
124
|
members: z.ZodOptional<z.ZodString>;
|
|
125
|
-
account_id: z.ZodNumber;
|
|
126
125
|
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
126
|
date: z.ZodString;
|
|
128
|
-
id: z.ZodNumber;
|
|
129
127
|
lastchanged: z.ZodOptional<z.ZodString>;
|
|
130
128
|
destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
129
|
is_invite_only: z.ZodBoolean;
|
|
@@ -138,8 +136,10 @@ export declare const GetAuthenticationResponseSchema: z.ZodObject<{
|
|
|
138
136
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
137
|
groups: z.ZodOptional<z.ZodString>;
|
|
140
138
|
permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
account_id: z.ZodString;
|
|
141
141
|
implementation_id: z.ZodOptional<z.ZodString>;
|
|
142
|
-
profile_id: z.ZodOptional<z.
|
|
142
|
+
profile_id: z.ZodOptional<z.ZodString>;
|
|
143
143
|
is_expired: z.ZodOptional<z.ZodString>;
|
|
144
144
|
expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
145
|
app_key: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/temporary-internal-core/schemas/authentications/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;iBAqB/B,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKxC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/temporary-internal-core/schemas/authentications/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;iBAqB/B,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKxC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;iBAMO,CAAC;AAEnD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;GAW7C,CAAC;AAEN,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC"}
|
|
@@ -47,9 +47,12 @@ export const AuthenticationItemSchema = AuthenticationSchema.omit({
|
|
|
47
47
|
selected_api: true,
|
|
48
48
|
customuser_id: true,
|
|
49
49
|
}).extend({
|
|
50
|
+
// Override numeric IDs with string versions (converted by normalizeAuthenticationItem)
|
|
51
|
+
id: z.string(),
|
|
52
|
+
account_id: z.string(),
|
|
50
53
|
// Renamed fields
|
|
51
54
|
implementation_id: z.string().optional(),
|
|
52
|
-
profile_id: z.
|
|
55
|
+
profile_id: z.string().optional(),
|
|
53
56
|
// Mapped fields (originals preserved in ...restOfAuth)
|
|
54
57
|
is_expired: z.string().optional(),
|
|
55
58
|
expired_at: z.string().nullable().optional(),
|
|
@@ -65,9 +68,7 @@ export const AuthenticationItemSchema = AuthenticationSchema.omit({
|
|
|
65
68
|
export const GetAuthenticationOptionsSchema = z
|
|
66
69
|
.object({
|
|
67
70
|
authenticationId: z
|
|
68
|
-
.number()
|
|
69
|
-
.int()
|
|
70
|
-
.positive()
|
|
71
|
+
.union([z.string(), z.number().int().positive()])
|
|
71
72
|
.describe("Authentication ID to retrieve"),
|
|
72
73
|
})
|
|
73
74
|
.describe("Get a specific authentication by ID");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../../src/temporary-internal-core/utils/transformations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAYT;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE;IAChD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,GAAG,MAAM,GAAG,SAAS,CAYrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACvD,kBAAkB,
|
|
1
|
+
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../../src/temporary-internal-core/utils/transformations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAYT;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE;IAChD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,GAAG,MAAM,GAAG,SAAS,CAYrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACvD,kBAAkB,CAyCpB"}
|
|
@@ -58,15 +58,17 @@ export function normalizeAuthenticationItem(auth, options = {}) {
|
|
|
58
58
|
appVersion = extractedVersion;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const { selected_api: selectedApi, customuser_id: profileId, ...restOfAuth } = auth;
|
|
61
|
+
const { selected_api: selectedApi, customuser_id: profileId, id, account_id: accountId, ...restOfAuth } = auth;
|
|
62
62
|
return {
|
|
63
63
|
...restOfAuth, // Pass through all other API response fields except selected_api
|
|
64
|
+
id: String(id), // Convert to string
|
|
65
|
+
account_id: String(accountId), // Convert to string
|
|
64
66
|
implementation_id: selectedApi, // Rename selected_api to implementation_id
|
|
65
67
|
title: auth.title || auth.label || undefined, // Coerce title from label if missing
|
|
66
68
|
is_expired: auth.is_stale, // Map is_stale to is_expired
|
|
67
69
|
expired_at: auth.marked_stale_at, // Map marked_stale_at to expired_at
|
|
68
70
|
app_key: appKey, // App key from implementations endpoint or parsed from selected_api
|
|
69
71
|
app_version: appVersion, // Version from selected_api or provided
|
|
70
|
-
profile_id: profileId, // Map customuser_id to profile_id
|
|
72
|
+
profile_id: profileId != null ? String(profileId) : undefined, // Map customuser_id to profile_id, convert to string
|
|
71
73
|
};
|
|
72
74
|
}
|
|
@@ -13,7 +13,7 @@ export declare const ActionTypePropertySchema: z.ZodEnum<{
|
|
|
13
13
|
write: "write";
|
|
14
14
|
}>;
|
|
15
15
|
export declare const ActionKeyPropertySchema: z.ZodString;
|
|
16
|
-
export declare const AuthenticationIdPropertySchema: z.ZodNumber
|
|
16
|
+
export declare const AuthenticationIdPropertySchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
17
17
|
export declare const InputsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
18
18
|
export declare const LimitPropertySchema: z.ZodDefault<z.ZodNumber>;
|
|
19
19
|
export declare const OffsetPropertySchema: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/types/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;CAKhC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;EAW4B,CAAC;AAElE,eAAO,MAAM,uBAAuB,aAGA,CAAC;AAErC,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/types/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;CAKhC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;EAW4B,CAAC;AAElE,eAAO,MAAM,uBAAuB,aAGA,CAAC;AAErC,eAAO,MAAM,8BAA8B,iDAEY,CAAC;AAExD,eAAO,MAAM,oBAAoB,wCAEa,CAAC;AAE/C,eAAO,MAAM,mBAAmB,2BAMgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,2BAKoB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,aAA0C,CAAC;AAE5E,eAAO,MAAM,mBAAmB,4BAGG,CAAC;AAEpC,eAAO,MAAM,oBAAoB,wCAEG,CAAC;AAGrC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/types/properties.js
CHANGED
|
@@ -24,8 +24,7 @@ export const ActionKeyPropertySchema = z
|
|
|
24
24
|
.min(1)
|
|
25
25
|
.describe("Action key to execute");
|
|
26
26
|
export const AuthenticationIdPropertySchema = z
|
|
27
|
-
.number()
|
|
28
|
-
.int()
|
|
27
|
+
.union([z.string(), z.number().int().positive()])
|
|
29
28
|
.describe("Authentication ID to use for this action");
|
|
30
29
|
export const InputsPropertySchema = z
|
|
31
30
|
.record(z.string(), z.unknown())
|
|
@@ -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,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE/E;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,GACnB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAQ9B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAYT;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACvD,kBAAkB,
|
|
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,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE/E;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,GACnB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAQ9B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAYT;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACvD,kBAAkB,CAyCpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAsB9D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IAC9D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAgCA;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IACrD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAUA;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOtD;AAED,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"}
|