assembly-kit 0.0.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/CLAUDE.md +205 -0
- package/LICENSE +21 -0
- package/README.md +516 -0
- package/dist/bridge-ui/index.d.mts +4 -0
- package/dist/bridge-ui/index.mjs +5 -0
- package/dist/bridge-ui/use-actions-menu.d.mts +16 -0
- package/dist/bridge-ui/use-actions-menu.mjs +33 -0
- package/dist/bridge-ui/use-actions-menu.mjs.map +1 -0
- package/dist/bridge-ui/use-primary-cta.d.mts +16 -0
- package/dist/bridge-ui/use-primary-cta.mjs +34 -0
- package/dist/bridge-ui/use-primary-cta.mjs.map +1 -0
- package/dist/bridge-ui/use-secondary-cta.d.mts +16 -0
- package/dist/bridge-ui/use-secondary-cta.mjs +34 -0
- package/dist/bridge-ui/use-secondary-cta.mjs.map +1 -0
- package/dist/client/index.d.mts +108 -0
- package/dist/client/index.mjs +168 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/client/options.d.mts +40 -0
- package/dist/constants/kit-mode.d.mts +15 -0
- package/dist/constants/kit-mode.mjs +15 -0
- package/dist/constants/kit-mode.mjs.map +1 -0
- package/dist/errors/base.d.mts +29 -0
- package/dist/errors/base.mjs +16 -0
- package/dist/errors/base.mjs.map +1 -0
- package/dist/errors/connection.d.mts +12 -0
- package/dist/errors/connection.mjs +16 -0
- package/dist/errors/connection.mjs.map +1 -0
- package/dist/errors/forbidden.d.mts +12 -0
- package/dist/errors/forbidden.mjs +16 -0
- package/dist/errors/forbidden.mjs.map +1 -0
- package/dist/errors/index.d.mts +13 -0
- package/dist/errors/index.mjs +13 -0
- package/dist/errors/invalid-token.d.mts +12 -0
- package/dist/errors/invalid-token.mjs +16 -0
- package/dist/errors/invalid-token.mjs.map +1 -0
- package/dist/errors/missing-api-key.d.mts +12 -0
- package/dist/errors/missing-api-key.mjs +16 -0
- package/dist/errors/missing-api-key.mjs.map +1 -0
- package/dist/errors/no-token.d.mts +12 -0
- package/dist/errors/no-token.mjs +16 -0
- package/dist/errors/no-token.mjs.map +1 -0
- package/dist/errors/not-found.d.mts +12 -0
- package/dist/errors/not-found.mjs +16 -0
- package/dist/errors/not-found.mjs.map +1 -0
- package/dist/errors/rate-limit.d.mts +17 -0
- package/dist/errors/rate-limit.mjs +18 -0
- package/dist/errors/rate-limit.mjs.map +1 -0
- package/dist/errors/response-parse.d.mts +19 -0
- package/dist/errors/response-parse.mjs +23 -0
- package/dist/errors/response-parse.mjs.map +1 -0
- package/dist/errors/server.d.mts +12 -0
- package/dist/errors/server.mjs +16 -0
- package/dist/errors/server.mjs.map +1 -0
- package/dist/errors/unauthorized.d.mts +12 -0
- package/dist/errors/unauthorized.mjs +16 -0
- package/dist/errors/unauthorized.mjs.map +1 -0
- package/dist/errors/validation.d.mts +12 -0
- package/dist/errors/validation.mjs +16 -0
- package/dist/errors/validation.mjs.map +1 -0
- package/dist/index.d.mts +49 -0
- package/dist/index.mjs +51 -0
- package/dist/lib/modules/app-connections/resource.d.mts +28 -0
- package/dist/lib/modules/app-connections/resource.mjs +33 -0
- package/dist/lib/modules/app-connections/resource.mjs.map +1 -0
- package/dist/lib/modules/app-connections/schema.d.mts +37 -0
- package/dist/lib/modules/app-connections/schema.mjs +30 -0
- package/dist/lib/modules/app-connections/schema.mjs.map +1 -0
- package/dist/lib/modules/app-installs/resource.d.mts +21 -0
- package/dist/lib/modules/app-installs/resource.mjs +31 -0
- package/dist/lib/modules/app-installs/resource.mjs.map +1 -0
- package/dist/lib/modules/app-installs/schema.d.mts +22 -0
- package/dist/lib/modules/app-installs/schema.mjs +23 -0
- package/dist/lib/modules/app-installs/schema.mjs.map +1 -0
- package/dist/lib/modules/clients/resource.d.mts +43 -0
- package/dist/lib/modules/clients/resource.mjs +62 -0
- package/dist/lib/modules/clients/resource.mjs.map +1 -0
- package/dist/lib/modules/clients/schema.d.mts +50 -0
- package/dist/lib/modules/clients/schema.mjs +52 -0
- package/dist/lib/modules/clients/schema.mjs.map +1 -0
- package/dist/lib/modules/companies/resource.d.mts +37 -0
- package/dist/lib/modules/companies/resource.mjs +60 -0
- package/dist/lib/modules/companies/resource.mjs.map +1 -0
- package/dist/lib/modules/companies/schema.d.mts +39 -0
- package/dist/lib/modules/companies/schema.mjs +34 -0
- package/dist/lib/modules/companies/schema.mjs.map +1 -0
- package/dist/lib/modules/contract-templates/resource.d.mts +27 -0
- package/dist/lib/modules/contract-templates/resource.mjs +40 -0
- package/dist/lib/modules/contract-templates/resource.mjs.map +1 -0
- package/dist/lib/modules/contract-templates/schema.d.mts +21 -0
- package/dist/lib/modules/contract-templates/schema.mjs +18 -0
- package/dist/lib/modules/contract-templates/schema.mjs.map +1 -0
- package/dist/lib/modules/contracts/resource.d.mts +29 -0
- package/dist/lib/modules/contracts/resource.mjs +40 -0
- package/dist/lib/modules/contracts/resource.mjs.map +1 -0
- package/dist/lib/modules/contracts/schema.d.mts +50 -0
- package/dist/lib/modules/contracts/schema.mjs +45 -0
- package/dist/lib/modules/contracts/schema.mjs.map +1 -0
- package/dist/lib/modules/custom-field-options/index.d.mts +1 -0
- package/dist/lib/modules/custom-field-options/index.mjs +2 -0
- package/dist/lib/modules/custom-field-options/resource.d.mts +22 -0
- package/dist/lib/modules/custom-field-options/resource.mjs +25 -0
- package/dist/lib/modules/custom-field-options/resource.mjs.map +1 -0
- package/dist/lib/modules/custom-field-options/schema.d.mts +18 -0
- package/dist/lib/modules/custom-field-options/schema.mjs +13 -0
- package/dist/lib/modules/custom-field-options/schema.mjs.map +1 -0
- package/dist/lib/modules/custom-fields/resource.d.mts +21 -0
- package/dist/lib/modules/custom-fields/resource.mjs +24 -0
- package/dist/lib/modules/custom-fields/resource.mjs.map +1 -0
- package/dist/lib/modules/custom-fields/schema.d.mts +43 -0
- package/dist/lib/modules/custom-fields/schema.mjs +44 -0
- package/dist/lib/modules/custom-fields/schema.mjs.map +1 -0
- package/dist/lib/modules/events/resource.d.mts +33 -0
- package/dist/lib/modules/events/resource.mjs +49 -0
- package/dist/lib/modules/events/resource.mjs.map +1 -0
- package/dist/lib/modules/events/schema.d.mts +52 -0
- package/dist/lib/modules/events/schema.mjs +49 -0
- package/dist/lib/modules/events/schema.mjs.map +1 -0
- package/dist/lib/modules/file-channels/resource.d.mts +26 -0
- package/dist/lib/modules/file-channels/resource.mjs +48 -0
- package/dist/lib/modules/file-channels/resource.mjs.map +1 -0
- package/dist/lib/modules/file-channels/schema.d.mts +33 -0
- package/dist/lib/modules/file-channels/schema.mjs +28 -0
- package/dist/lib/modules/file-channels/schema.mjs.map +1 -0
- package/dist/lib/modules/files/resource.d.mts +40 -0
- package/dist/lib/modules/files/resource.mjs +52 -0
- package/dist/lib/modules/files/resource.mjs.map +1 -0
- package/dist/lib/modules/files/schema.d.mts +27 -0
- package/dist/lib/modules/files/schema.mjs +27 -0
- package/dist/lib/modules/files/schema.mjs.map +1 -0
- package/dist/lib/modules/form-responses/resource.d.mts +24 -0
- package/dist/lib/modules/form-responses/resource.mjs +34 -0
- package/dist/lib/modules/form-responses/resource.mjs.map +1 -0
- package/dist/lib/modules/form-responses/schema.d.mts +29 -0
- package/dist/lib/modules/form-responses/schema.mjs +23 -0
- package/dist/lib/modules/form-responses/schema.mjs.map +1 -0
- package/dist/lib/modules/forms/resource.d.mts +24 -0
- package/dist/lib/modules/forms/resource.mjs +40 -0
- package/dist/lib/modules/forms/resource.mjs.map +1 -0
- package/dist/lib/modules/forms/schema.d.mts +22 -0
- package/dist/lib/modules/forms/schema.mjs +19 -0
- package/dist/lib/modules/forms/schema.mjs.map +1 -0
- package/dist/lib/modules/index.d.mts +28 -0
- package/dist/lib/modules/index.mjs +29 -0
- package/dist/lib/modules/internal-users/resource.d.mts +24 -0
- package/dist/lib/modules/internal-users/resource.mjs +37 -0
- package/dist/lib/modules/internal-users/resource.mjs.map +1 -0
- package/dist/lib/modules/internal-users/schema.d.mts +27 -0
- package/dist/lib/modules/internal-users/schema.mjs +24 -0
- package/dist/lib/modules/internal-users/schema.mjs.map +1 -0
- package/dist/lib/modules/invoice-templates/resource.d.mts +22 -0
- package/dist/lib/modules/invoice-templates/resource.mjs +32 -0
- package/dist/lib/modules/invoice-templates/resource.mjs.map +1 -0
- package/dist/lib/modules/invoice-templates/schema.d.mts +21 -0
- package/dist/lib/modules/invoice-templates/schema.mjs +18 -0
- package/dist/lib/modules/invoice-templates/schema.mjs.map +1 -0
- package/dist/lib/modules/invoices/resource.d.mts +30 -0
- package/dist/lib/modules/invoices/resource.mjs +48 -0
- package/dist/lib/modules/invoices/resource.mjs.map +1 -0
- package/dist/lib/modules/invoices/schema.d.mts +81 -0
- package/dist/lib/modules/invoices/schema.mjs +75 -0
- package/dist/lib/modules/invoices/schema.mjs.map +1 -0
- package/dist/lib/modules/message-channels/resource.d.mts +26 -0
- package/dist/lib/modules/message-channels/resource.mjs +48 -0
- package/dist/lib/modules/message-channels/resource.mjs.map +1 -0
- package/dist/lib/modules/message-channels/schema.d.mts +35 -0
- package/dist/lib/modules/message-channels/schema.mjs +30 -0
- package/dist/lib/modules/message-channels/schema.mjs.map +1 -0
- package/dist/lib/modules/messages/resource.d.mts +27 -0
- package/dist/lib/modules/messages/resource.mjs +40 -0
- package/dist/lib/modules/messages/resource.mjs.map +1 -0
- package/dist/lib/modules/messages/schema.d.mts +30 -0
- package/dist/lib/modules/messages/schema.mjs +26 -0
- package/dist/lib/modules/messages/schema.mjs.map +1 -0
- package/dist/lib/modules/notes/resource.d.mts +37 -0
- package/dist/lib/modules/notes/resource.mjs +60 -0
- package/dist/lib/modules/notes/resource.mjs.map +1 -0
- package/dist/lib/modules/notes/schema.d.mts +34 -0
- package/dist/lib/modules/notes/schema.mjs +27 -0
- package/dist/lib/modules/notes/schema.mjs.map +1 -0
- package/dist/lib/modules/notifications/resource.d.mts +27 -0
- package/dist/lib/modules/notifications/resource.mjs +52 -0
- package/dist/lib/modules/notifications/resource.mjs.map +1 -0
- package/dist/lib/modules/notifications/schema.d.mts +52 -0
- package/dist/lib/modules/notifications/schema.mjs +43 -0
- package/dist/lib/modules/notifications/schema.mjs.map +1 -0
- package/dist/lib/modules/payments/resource.d.mts +26 -0
- package/dist/lib/modules/payments/resource.mjs +32 -0
- package/dist/lib/modules/payments/resource.mjs.map +1 -0
- package/dist/lib/modules/payments/schema.d.mts +23 -0
- package/dist/lib/modules/payments/schema.mjs +20 -0
- package/dist/lib/modules/payments/schema.mjs.map +1 -0
- package/dist/lib/modules/prices/resource.d.mts +27 -0
- package/dist/lib/modules/prices/resource.mjs +40 -0
- package/dist/lib/modules/prices/resource.mjs.map +1 -0
- package/dist/lib/modules/prices/schema.d.mts +22 -0
- package/dist/lib/modules/prices/schema.mjs +19 -0
- package/dist/lib/modules/prices/schema.mjs.map +1 -0
- package/dist/lib/modules/products/resource.d.mts +24 -0
- package/dist/lib/modules/products/resource.mjs +40 -0
- package/dist/lib/modules/products/resource.mjs.map +1 -0
- package/dist/lib/modules/products/schema.d.mts +22 -0
- package/dist/lib/modules/products/schema.mjs +19 -0
- package/dist/lib/modules/products/schema.mjs.map +1 -0
- package/dist/lib/modules/subscription-templates/resource.d.mts +22 -0
- package/dist/lib/modules/subscription-templates/resource.mjs +32 -0
- package/dist/lib/modules/subscription-templates/resource.mjs.map +1 -0
- package/dist/lib/modules/subscription-templates/schema.d.mts +21 -0
- package/dist/lib/modules/subscription-templates/schema.mjs +18 -0
- package/dist/lib/modules/subscription-templates/schema.mjs.map +1 -0
- package/dist/lib/modules/subscriptions/resource.d.mts +32 -0
- package/dist/lib/modules/subscriptions/resource.mjs +56 -0
- package/dist/lib/modules/subscriptions/resource.mjs.map +1 -0
- package/dist/lib/modules/subscriptions/schema.d.mts +31 -0
- package/dist/lib/modules/subscriptions/schema.mjs +26 -0
- package/dist/lib/modules/subscriptions/schema.mjs.map +1 -0
- package/dist/lib/modules/task-templates/resource.d.mts +24 -0
- package/dist/lib/modules/task-templates/resource.mjs +40 -0
- package/dist/lib/modules/task-templates/resource.mjs.map +1 -0
- package/dist/lib/modules/task-templates/schema.d.mts +22 -0
- package/dist/lib/modules/task-templates/schema.mjs +19 -0
- package/dist/lib/modules/task-templates/schema.mjs.map +1 -0
- package/dist/lib/modules/tasks/resource.d.mts +38 -0
- package/dist/lib/modules/tasks/resource.mjs +60 -0
- package/dist/lib/modules/tasks/resource.mjs.map +1 -0
- package/dist/lib/modules/tasks/schema.d.mts +45 -0
- package/dist/lib/modules/tasks/schema.mjs +43 -0
- package/dist/lib/modules/tasks/schema.mjs.map +1 -0
- package/dist/lib/modules/workspace/resource.d.mts +19 -0
- package/dist/lib/modules/workspace/resource.mjs +23 -0
- package/dist/lib/modules/workspace/resource.mjs.map +1 -0
- package/dist/lib/modules/workspace/schema.d.mts +23 -0
- package/dist/lib/modules/workspace/schema.mjs +21 -0
- package/dist/lib/modules/workspace/schema.mjs.map +1 -0
- package/dist/lib/pagination/paginate.d.mts +8 -0
- package/dist/lib/pagination/paginate.mjs +24 -0
- package/dist/lib/pagination/paginate.mjs.map +1 -0
- package/dist/logger/index.d.mts +26 -0
- package/dist/logger/index.mjs +45 -0
- package/dist/logger/index.mjs.map +1 -0
- package/dist/schemas/index.d.mts +32 -0
- package/dist/schemas/index.mjs +34 -0
- package/dist/schemas/shared/hex-color.d.mts +8 -0
- package/dist/schemas/shared/hex-color.mjs +7 -0
- package/dist/schemas/shared/hex-color.mjs.map +1 -0
- package/dist/schemas/shared/index.d.mts +3 -0
- package/dist/schemas/shared/index.mjs +4 -0
- package/dist/schemas/shared/membership-type.d.mts +9 -0
- package/dist/schemas/shared/membership-type.mjs +11 -0
- package/dist/schemas/shared/membership-type.mjs.map +1 -0
- package/dist/schemas/shared/token.d.mts +22 -0
- package/dist/schemas/shared/token.mjs +21 -0
- package/dist/schemas/shared/token.mjs.map +1 -0
- package/dist/token/assembly-token.d.mts +96 -0
- package/dist/token/assembly-token.mjs +117 -0
- package/dist/token/assembly-token.mjs.map +1 -0
- package/dist/token/crypto.mjs +98 -0
- package/dist/token/crypto.mjs.map +1 -0
- package/dist/token/index.d.mts +3 -0
- package/dist/token/index.mjs +3 -0
- package/dist/token/parse.d.mts +24 -0
- package/dist/token/parse.mjs +62 -0
- package/dist/token/parse.mjs.map +1 -0
- package/dist/transport/build-search-params.mjs +16 -0
- package/dist/transport/build-search-params.mjs.map +1 -0
- package/dist/transport/http.d.mts +14 -0
- package/dist/transport/http.mjs +142 -0
- package/dist/transport/http.mjs.map +1 -0
- package/dist/transport/parse-response.mjs +17 -0
- package/dist/transport/parse-response.mjs.map +1 -0
- package/dist/version.mjs +7 -0
- package/dist/version.mjs.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-api-key.mjs","names":[],"sources":["../../src/errors/missing-api-key.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport class AssemblyMissingApiKeyError extends AssemblyError {\n constructor({ message, ...rest }: AssemblyErrorOptions = {}) {\n super({\n message: message ?? \"Assembly API key is missing or empty\",\n statusCode: 400,\n ...rest,\n });\n this.name = \"AssemblyMissingApiKeyError\";\n }\n}\n"],"mappings":";;AAGA,IAAa,6BAAb,cAAgD,cAAc;CAC5D,YAAY,EAAE,SAAS,GAAG,SAA+B,EAAE,EAAE;AAC3D,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/no-token.d.ts
|
|
4
|
+
declare class AssemblyNoTokenError extends AssemblyError {
|
|
5
|
+
constructor({
|
|
6
|
+
message,
|
|
7
|
+
...rest
|
|
8
|
+
}?: AssemblyErrorOptions);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AssemblyNoTokenError };
|
|
12
|
+
//# sourceMappingURL=no-token.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
//#region src/errors/no-token.ts
|
|
3
|
+
var AssemblyNoTokenError = class extends AssemblyError {
|
|
4
|
+
constructor({ message, ...rest } = {}) {
|
|
5
|
+
super({
|
|
6
|
+
message: message ?? "A token is required for this operation but was not provided",
|
|
7
|
+
statusCode: 400,
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
this.name = "AssemblyNoTokenError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AssemblyNoTokenError };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=no-token.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-token.mjs","names":[],"sources":["../../src/errors/no-token.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport class AssemblyNoTokenError extends AssemblyError {\n constructor({ message, ...rest }: AssemblyErrorOptions = {}) {\n super({\n message: message ?? \"A token is required for this operation but was not provided\",\n statusCode: 400,\n ...rest,\n });\n this.name = \"AssemblyNoTokenError\";\n }\n}\n"],"mappings":";;AAGA,IAAa,uBAAb,cAA0C,cAAc;CACtD,YAAY,EAAE,SAAS,GAAG,SAA+B,EAAE,EAAE;AAC3D,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/not-found.d.ts
|
|
4
|
+
declare class AssemblyNotFoundError extends AssemblyError {
|
|
5
|
+
constructor({
|
|
6
|
+
message,
|
|
7
|
+
...rest
|
|
8
|
+
}?: AssemblyErrorOptions);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AssemblyNotFoundError };
|
|
12
|
+
//# sourceMappingURL=not-found.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
//#region src/errors/not-found.ts
|
|
3
|
+
var AssemblyNotFoundError = class extends AssemblyError {
|
|
4
|
+
constructor({ message, ...rest } = {}) {
|
|
5
|
+
super({
|
|
6
|
+
message: message ?? "The requested resource was not found",
|
|
7
|
+
statusCode: 404,
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
this.name = "AssemblyNotFoundError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AssemblyNotFoundError };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=not-found.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found.mjs","names":[],"sources":["../../src/errors/not-found.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport class AssemblyNotFoundError extends AssemblyError {\n constructor({ message, ...rest }: AssemblyErrorOptions = {}) {\n super({\n message: message ?? \"The requested resource was not found\",\n statusCode: 404,\n ...rest,\n });\n this.name = \"AssemblyNotFoundError\";\n }\n}\n"],"mappings":";;AAGA,IAAa,wBAAb,cAA2C,cAAc;CACvD,YAAY,EAAE,SAAS,GAAG,SAA+B,EAAE,EAAE;AAC3D,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/rate-limit.d.ts
|
|
4
|
+
interface AssemblyRateLimitErrorOptions extends AssemblyErrorOptions {
|
|
5
|
+
retryAfter?: number;
|
|
6
|
+
}
|
|
7
|
+
declare class AssemblyRateLimitError extends AssemblyError {
|
|
8
|
+
readonly retryAfter?: number;
|
|
9
|
+
constructor({
|
|
10
|
+
message,
|
|
11
|
+
retryAfter,
|
|
12
|
+
...rest
|
|
13
|
+
}?: AssemblyRateLimitErrorOptions);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { AssemblyRateLimitError, AssemblyRateLimitErrorOptions };
|
|
17
|
+
//# sourceMappingURL=rate-limit.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
//#region src/errors/rate-limit.ts
|
|
3
|
+
var AssemblyRateLimitError = class extends AssemblyError {
|
|
4
|
+
retryAfter;
|
|
5
|
+
constructor({ message, retryAfter, ...rest } = {}) {
|
|
6
|
+
super({
|
|
7
|
+
message: message ?? "Rate limit exceeded",
|
|
8
|
+
statusCode: 429,
|
|
9
|
+
...rest
|
|
10
|
+
});
|
|
11
|
+
this.name = "AssemblyRateLimitError";
|
|
12
|
+
this.retryAfter = retryAfter;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { AssemblyRateLimitError };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=rate-limit.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limit.mjs","names":[],"sources":["../../src/errors/rate-limit.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport interface AssemblyRateLimitErrorOptions extends AssemblyErrorOptions {\n retryAfter?: number;\n}\n\nexport class AssemblyRateLimitError extends AssemblyError {\n readonly retryAfter?: number;\n\n constructor({ message, retryAfter, ...rest }: AssemblyRateLimitErrorOptions = {}) {\n super({\n message: message ?? \"Rate limit exceeded\",\n statusCode: 429,\n ...rest,\n });\n this.name = \"AssemblyRateLimitError\";\n this.retryAfter = retryAfter;\n }\n}\n"],"mappings":";;AAOA,IAAa,yBAAb,cAA4C,cAAc;CACxD;CAEA,YAAY,EAAE,SAAS,YAAY,GAAG,SAAwC,EAAE,EAAE;AAChF,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO;AACZ,OAAK,aAAa"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
import { ZodError } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/errors/response-parse.d.ts
|
|
5
|
+
interface AssemblyResponseParseErrorOptions extends Omit<AssemblyErrorOptions, "cause"> {
|
|
6
|
+
cause: ZodError;
|
|
7
|
+
}
|
|
8
|
+
declare class AssemblyResponseParseError extends AssemblyError {
|
|
9
|
+
readonly validationErrors: string;
|
|
10
|
+
constructor({
|
|
11
|
+
message,
|
|
12
|
+
cause,
|
|
13
|
+
details
|
|
14
|
+
}: AssemblyResponseParseErrorOptions);
|
|
15
|
+
get cause(): ZodError;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AssemblyResponseParseError, AssemblyResponseParseErrorOptions };
|
|
19
|
+
//# sourceMappingURL=response-parse.d.mts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/errors/response-parse.ts
|
|
4
|
+
var AssemblyResponseParseError = class extends AssemblyError {
|
|
5
|
+
validationErrors;
|
|
6
|
+
constructor({ message, cause, details }) {
|
|
7
|
+
super({
|
|
8
|
+
cause,
|
|
9
|
+
details,
|
|
10
|
+
message: message ?? "Assembly API response did not match the expected schema",
|
|
11
|
+
statusCode: 500
|
|
12
|
+
});
|
|
13
|
+
this.name = "AssemblyResponseParseError";
|
|
14
|
+
this.validationErrors = z.prettifyError(cause);
|
|
15
|
+
}
|
|
16
|
+
get cause() {
|
|
17
|
+
return super.cause;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AssemblyResponseParseError };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=response-parse.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-parse.mjs","names":[],"sources":["../../src/errors/response-parse.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\nimport { z } from \"zod\";\nimport type { ZodError } from \"zod\";\n\nexport interface AssemblyResponseParseErrorOptions extends Omit<AssemblyErrorOptions, \"cause\"> {\n cause: ZodError;\n}\n\nexport class AssemblyResponseParseError extends AssemblyError {\n readonly validationErrors: string;\n\n constructor({ message, cause, details }: AssemblyResponseParseErrorOptions) {\n super({\n cause,\n details,\n message: message ?? \"Assembly API response did not match the expected schema\",\n statusCode: 500,\n });\n this.name = \"AssemblyResponseParseError\";\n this.validationErrors = z.prettifyError(cause);\n }\n\n // Narrows the inherited Error.cause to ZodError — safe because the\n // constructor enforces cause: ZodError at the call site.\n override get cause(): ZodError {\n return super.cause as ZodError;\n }\n}\n"],"mappings":";;;AASA,IAAa,6BAAb,cAAgD,cAAc;CAC5D;CAEA,YAAY,EAAE,SAAS,OAAO,WAA8C;AAC1E,QAAM;GACJ;GACA;GACA,SAAS,WAAW;GACpB,YAAY;GACb,CAAC;AACF,OAAK,OAAO;AACZ,OAAK,mBAAmB,EAAE,cAAc,MAAM;;CAKhD,IAAa,QAAkB;AAC7B,SAAO,MAAM"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/server.d.ts
|
|
4
|
+
declare class AssemblyServerError extends AssemblyError {
|
|
5
|
+
constructor({
|
|
6
|
+
message,
|
|
7
|
+
...rest
|
|
8
|
+
}?: AssemblyErrorOptions);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AssemblyServerError };
|
|
12
|
+
//# sourceMappingURL=server.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
//#region src/errors/server.ts
|
|
3
|
+
var AssemblyServerError = class extends AssemblyError {
|
|
4
|
+
constructor({ message, ...rest } = {}) {
|
|
5
|
+
super({
|
|
6
|
+
message: message ?? "An unexpected error occurred on the Assembly server",
|
|
7
|
+
statusCode: 500,
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
this.name = "AssemblyServerError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AssemblyServerError };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.mjs","names":[],"sources":["../../src/errors/server.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport class AssemblyServerError extends AssemblyError {\n constructor({ message, ...rest }: AssemblyErrorOptions = {}) {\n super({\n message: message ?? \"An unexpected error occurred on the Assembly server\",\n statusCode: 500,\n ...rest,\n });\n this.name = \"AssemblyServerError\";\n }\n}\n"],"mappings":";;AAGA,IAAa,sBAAb,cAAyC,cAAc;CACrD,YAAY,EAAE,SAAS,GAAG,SAA+B,EAAE,EAAE;AAC3D,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/unauthorized.d.ts
|
|
4
|
+
declare class AssemblyUnauthorizedError extends AssemblyError {
|
|
5
|
+
constructor({
|
|
6
|
+
message,
|
|
7
|
+
...rest
|
|
8
|
+
}?: AssemblyErrorOptions);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AssemblyUnauthorizedError };
|
|
12
|
+
//# sourceMappingURL=unauthorized.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
//#region src/errors/unauthorized.ts
|
|
3
|
+
var AssemblyUnauthorizedError = class extends AssemblyError {
|
|
4
|
+
constructor({ message, ...rest } = {}) {
|
|
5
|
+
super({
|
|
6
|
+
message: message ?? "Unauthorized: the API key was rejected by Assembly",
|
|
7
|
+
statusCode: 401,
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
this.name = "AssemblyUnauthorizedError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AssemblyUnauthorizedError };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=unauthorized.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unauthorized.mjs","names":[],"sources":["../../src/errors/unauthorized.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport class AssemblyUnauthorizedError extends AssemblyError {\n constructor({ message, ...rest }: AssemblyErrorOptions = {}) {\n super({\n message: message ?? \"Unauthorized: the API key was rejected by Assembly\",\n statusCode: 401,\n ...rest,\n });\n this.name = \"AssemblyUnauthorizedError\";\n }\n}\n"],"mappings":";;AAGA,IAAa,4BAAb,cAA+C,cAAc;CAC3D,YAAY,EAAE,SAAS,GAAG,SAA+B,EAAE,EAAE;AAC3D,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssemblyError, AssemblyErrorOptions } from "./base.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/validation.d.ts
|
|
4
|
+
declare class AssemblyValidationError extends AssemblyError {
|
|
5
|
+
constructor({
|
|
6
|
+
message,
|
|
7
|
+
...rest
|
|
8
|
+
}?: AssemblyErrorOptions);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AssemblyValidationError };
|
|
12
|
+
//# sourceMappingURL=validation.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssemblyError } from "./base.mjs";
|
|
2
|
+
//#region src/errors/validation.ts
|
|
3
|
+
var AssemblyValidationError = class extends AssemblyError {
|
|
4
|
+
constructor({ message, ...rest } = {}) {
|
|
5
|
+
super({
|
|
6
|
+
message: message ?? "The request payload was rejected by the Assembly API",
|
|
7
|
+
statusCode: 422,
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
this.name = "AssemblyValidationError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AssemblyValidationError };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=validation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.mjs","names":[],"sources":["../../src/errors/validation.ts"],"sourcesContent":["import { AssemblyError } from \"src/errors/base\";\nimport type { AssemblyErrorOptions } from \"src/errors/base\";\n\nexport class AssemblyValidationError extends AssemblyError {\n constructor({ message, ...rest }: AssemblyErrorOptions = {}) {\n super({\n message: message ?? \"The request payload was rejected by the Assembly API\",\n statusCode: 422,\n ...rest,\n });\n this.name = \"AssemblyValidationError\";\n }\n}\n"],"mappings":";;AAGA,IAAa,0BAAb,cAA6C,cAAc;CACzD,YAAY,EAAE,SAAS,GAAG,SAA+B,EAAE,EAAE;AAC3D,QAAM;GACJ,SAAS,WAAW;GACpB,YAAY;GACZ,GAAG;GACJ,CAAC;AACF,OAAK,OAAO"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MembershipType, MembershipTypeSchema } from "./schemas/shared/membership-type.mjs";
|
|
2
|
+
import { AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema } from "./lib/modules/app-connections/schema.mjs";
|
|
3
|
+
import { AppInstall, AppInstallResponse, AppInstallResponseSchema, AppInstallSchema, AppInstallType, AppInstallTypeSchema, AppInstallsResponse, AppInstallsResponseSchema } from "./lib/modules/app-installs/schema.mjs";
|
|
4
|
+
import { Client, ClientCreateRequest, ClientCreateRequestSchema, ClientResponse, ClientResponseSchema, ClientSchema, ClientUpdateRequest, ClientUpdateRequestSchema, ClientsResponse, ClientsResponseSchema } from "./lib/modules/clients/schema.mjs";
|
|
5
|
+
import { HexColor, HexColorSchema } from "./schemas/shared/hex-color.mjs";
|
|
6
|
+
import { CompaniesResponse, CompaniesResponseSchema, Company, CompanyCreateRequest, CompanyCreateRequestSchema, CompanyResponse, CompanyResponseSchema, CompanySchema, CompanyUpdateRequest, CompanyUpdateRequestSchema } from "./lib/modules/companies/schema.mjs";
|
|
7
|
+
import { ContractTemplate, ContractTemplateResponse, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponse, ContractTemplatesResponseSchema } from "./lib/modules/contract-templates/schema.mjs";
|
|
8
|
+
import { Contract, ContractField, ContractFieldInputType, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponse, ContractResponseSchema, ContractSchema, ContractSendRequest, ContractSendRequestSchema, ContractStatus, ContractStatusSchema, ContractsResponse, ContractsResponseSchema } from "./lib/modules/contracts/schema.mjs";
|
|
9
|
+
import { CustomFieldOption, CustomFieldOptionSchema, ListCustomFieldOptionResponse, ListCustomFieldOptionResponseSchema } from "./lib/modules/custom-field-options/schema.mjs";
|
|
10
|
+
import { AddressValue, AddressValueSchema, CustomField, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "./lib/modules/custom-fields/schema.mjs";
|
|
11
|
+
import { AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, ClientUserEventCreateRequest, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, InternalUserEventCreateRequest } from "./lib/modules/events/schema.mjs";
|
|
12
|
+
import { FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema } from "./lib/modules/file-channels/schema.mjs";
|
|
13
|
+
import { AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, FileType, FileTypeSchema } from "./lib/modules/files/schema.mjs";
|
|
14
|
+
import { FormResponse, FormResponseCreateRequest, FormResponseCreateRequestSchema, FormResponseItemResponse, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponse, FormResponsesResponseSchema } from "./lib/modules/form-responses/schema.mjs";
|
|
15
|
+
import { Form, FormDataResponse, FormDataResponseSchema, FormSchema, FormsDataResponse, FormsDataResponseSchema } from "./lib/modules/forms/schema.mjs";
|
|
16
|
+
import { InternalUser, InternalUserResponse, InternalUserResponseSchema, InternalUserSchema, InternalUsersResponse, InternalUsersResponseSchema } from "./lib/modules/internal-users/schema.mjs";
|
|
17
|
+
import { InvoiceTemplate, InvoiceTemplateResponse, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponse, InvoiceTemplatesResponseSchema } from "./lib/modules/invoice-templates/schema.mjs";
|
|
18
|
+
import { Invoice, InvoiceCreateRequest, InvoiceCreateRequestSchema, InvoiceLineItem, InvoiceLineItemRequest, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequest, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponse, InvoiceResponseSchema, InvoiceSchema, InvoiceStatus, InvoiceStatusSchema, InvoicesResponse, InvoicesResponseSchema, PaymentMethodPreference, PaymentMethodPreferenceSchema, PaymentMethodType, PaymentMethodTypeSchema } from "./lib/modules/invoices/schema.mjs";
|
|
19
|
+
import { MessageChannel, MessageChannelCreateRequest, MessageChannelCreateRequestSchema, MessageChannelResponse, MessageChannelResponseSchema, MessageChannelSchema, MessageChannelsResponse, MessageChannelsResponseSchema } from "./lib/modules/message-channels/schema.mjs";
|
|
20
|
+
import { Message, MessageResponse, MessageResponseSchema, MessageSchema, MessagesResponse, MessagesResponseSchema, SendMessageRequest, SendMessageRequestSchema } from "./lib/modules/messages/schema.mjs";
|
|
21
|
+
import { Note, NoteCreateRequest, NoteCreateRequestSchema, NoteResponse, NoteResponseSchema, NoteSchema, NoteUpdateRequest, NoteUpdateRequestSchema, NotesResponse, NotesResponseSchema } from "./lib/modules/notes/schema.mjs";
|
|
22
|
+
import { EmailDeliveryTarget, EmailDeliveryTargetSchema, InProductDeliveryTarget, InProductDeliveryTargetSchema, Notification, NotificationCreateRequest, NotificationCreateRequestSchema, NotificationDeliveryTargets, NotificationDeliveryTargetsSchema, NotificationResponse, NotificationResponseSchema, NotificationSchema, NotificationsResponse, NotificationsResponseSchema } from "./lib/modules/notifications/schema.mjs";
|
|
23
|
+
import { Payment, PaymentResponse, PaymentResponseSchema, PaymentSchema, PaymentsResponse, PaymentsResponseSchema } from "./lib/modules/payments/schema.mjs";
|
|
24
|
+
import { Price, PriceResponse, PriceResponseSchema, PriceSchema, PricesResponse, PricesResponseSchema } from "./lib/modules/prices/schema.mjs";
|
|
25
|
+
import { Product, ProductResponse, ProductResponseSchema, ProductSchema, ProductsResponse, ProductsResponseSchema } from "./lib/modules/products/schema.mjs";
|
|
26
|
+
import { SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponse, SubscriptionTemplatesResponseSchema } from "./lib/modules/subscription-templates/schema.mjs";
|
|
27
|
+
import { Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponse, SubscriptionsResponseSchema } from "./lib/modules/subscriptions/schema.mjs";
|
|
28
|
+
import { TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema } from "./lib/modules/task-templates/schema.mjs";
|
|
29
|
+
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema } from "./lib/modules/tasks/schema.mjs";
|
|
30
|
+
import { Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema } from "./lib/modules/workspace/schema.mjs";
|
|
31
|
+
import { TokenPayload, TokenPayloadSchema } from "./schemas/shared/token.mjs";
|
|
32
|
+
import { AssemblyToken, ClientTokenPayload, InternalUserTokenPayload } from "./token/assembly-token.mjs";
|
|
33
|
+
import { KitMode } from "./constants/kit-mode.mjs";
|
|
34
|
+
import { AssemblyKitOptions } from "./client/options.mjs";
|
|
35
|
+
import { AssemblyKit, createAssemblyKit } from "./client/index.mjs";
|
|
36
|
+
import { AssemblyError, AssemblyErrorOptions } from "./errors/base.mjs";
|
|
37
|
+
import { AssemblyConnectionError } from "./errors/connection.mjs";
|
|
38
|
+
import { AssemblyForbiddenError } from "./errors/forbidden.mjs";
|
|
39
|
+
import { AssemblyInvalidTokenError } from "./errors/invalid-token.mjs";
|
|
40
|
+
import { AssemblyMissingApiKeyError } from "./errors/missing-api-key.mjs";
|
|
41
|
+
import { AssemblyNoTokenError } from "./errors/no-token.mjs";
|
|
42
|
+
import { AssemblyNotFoundError } from "./errors/not-found.mjs";
|
|
43
|
+
import { AssemblyRateLimitError, AssemblyRateLimitErrorOptions } from "./errors/rate-limit.mjs";
|
|
44
|
+
import { AssemblyResponseParseError, AssemblyResponseParseErrorOptions } from "./errors/response-parse.mjs";
|
|
45
|
+
import { AssemblyServerError } from "./errors/server.mjs";
|
|
46
|
+
import { AssemblyUnauthorizedError } from "./errors/unauthorized.mjs";
|
|
47
|
+
import { AssemblyValidationError } from "./errors/validation.mjs";
|
|
48
|
+
import { createToken } from "./token/parse.mjs";
|
|
49
|
+
export { AddressValue, AddressValueSchema, AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema, AppInstall, AppInstallResponse, AppInstallResponseSchema, AppInstallSchema, AppInstallType, AppInstallTypeSchema, AppInstallsResponse, AppInstallsResponseSchema, AssemblyConnectionError, AssemblyError, AssemblyErrorOptions, AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, AssemblyForbiddenError, AssemblyInvalidTokenError, AssemblyKit, AssemblyKitOptions, AssemblyMissingApiKeyError, AssemblyNoTokenError, AssemblyNotFoundError, AssemblyRateLimitError, AssemblyRateLimitErrorOptions, AssemblyResponseParseError, AssemblyResponseParseErrorOptions, AssemblyServerError, AssemblyToken, AssemblyUnauthorizedError, AssemblyValidationError, AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, Client, ClientCreateRequest, ClientCreateRequestSchema, ClientResponse, ClientResponseSchema, ClientSchema, ClientTokenPayload, ClientUpdateRequest, ClientUpdateRequestSchema, ClientUserEventCreateRequest, ClientsResponse, ClientsResponseSchema, CompaniesResponse, CompaniesResponseSchema, Company, CompanyCreateRequest, CompanyCreateRequestSchema, CompanyResponse, CompanyResponseSchema, CompanySchema, CompanyUpdateRequest, CompanyUpdateRequestSchema, Contract, ContractField, ContractFieldInputType, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponse, ContractResponseSchema, ContractSchema, ContractSendRequest, ContractSendRequestSchema, ContractStatus, ContractStatusSchema, ContractTemplate, ContractTemplateResponse, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponse, ContractTemplatesResponseSchema, ContractsResponse, ContractsResponseSchema, CustomField, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldOption, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, EmailDeliveryTarget, EmailDeliveryTargetSchema, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema, FileType, FileTypeSchema, Form, FormDataResponse, FormDataResponseSchema, FormResponse, FormResponseCreateRequest, FormResponseCreateRequestSchema, FormResponseItemResponse, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponse, FormResponsesResponseSchema, FormSchema, FormsDataResponse, FormsDataResponseSchema, HexColor, HexColorSchema, InProductDeliveryTarget, InProductDeliveryTargetSchema, InternalUser, InternalUserEventCreateRequest, InternalUserResponse, InternalUserResponseSchema, InternalUserSchema, InternalUserTokenPayload, InternalUsersResponse, InternalUsersResponseSchema, Invoice, InvoiceCreateRequest, InvoiceCreateRequestSchema, InvoiceLineItem, InvoiceLineItemRequest, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequest, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponse, InvoiceResponseSchema, InvoiceSchema, InvoiceStatus, InvoiceStatusSchema, InvoiceTemplate, InvoiceTemplateResponse, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponse, InvoiceTemplatesResponseSchema, InvoicesResponse, InvoicesResponseSchema, KitMode, ListCustomFieldOptionResponse, ListCustomFieldOptionResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema, MembershipType, MembershipTypeSchema, Message, MessageChannel, MessageChannelCreateRequest, MessageChannelCreateRequestSchema, MessageChannelResponse, MessageChannelResponseSchema, MessageChannelSchema, MessageChannelsResponse, MessageChannelsResponseSchema, MessageResponse, MessageResponseSchema, MessageSchema, MessagesResponse, MessagesResponseSchema, Note, NoteCreateRequest, NoteCreateRequestSchema, NoteResponse, NoteResponseSchema, NoteSchema, NoteUpdateRequest, NoteUpdateRequestSchema, NotesResponse, NotesResponseSchema, Notification, NotificationCreateRequest, NotificationCreateRequestSchema, NotificationDeliveryTargets, NotificationDeliveryTargetsSchema, NotificationResponse, NotificationResponseSchema, NotificationSchema, NotificationsResponse, NotificationsResponseSchema, Payment, PaymentMethodPreference, PaymentMethodPreferenceSchema, PaymentMethodType, PaymentMethodTypeSchema, PaymentResponse, PaymentResponseSchema, PaymentSchema, PaymentsResponse, PaymentsResponseSchema, Price, PriceResponse, PriceResponseSchema, PriceSchema, PricesResponse, PricesResponseSchema, Product, ProductResponse, ProductResponseSchema, ProductSchema, ProductsResponse, ProductsResponseSchema, SendMessageRequest, SendMessageRequestSchema, Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponse, SubscriptionTemplatesResponseSchema, SubscriptionsResponse, SubscriptionsResponseSchema, Task, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema, TokenPayload, TokenPayloadSchema, Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema, createAssemblyKit, createToken };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AssemblyError } from "./errors/base.mjs";
|
|
2
|
+
import { AssemblyNoTokenError } from "./errors/no-token.mjs";
|
|
3
|
+
import { AssemblyResponseParseError } from "./errors/response-parse.mjs";
|
|
4
|
+
import { MembershipTypeSchema } from "./schemas/shared/membership-type.mjs";
|
|
5
|
+
import { AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema } from "./lib/modules/app-connections/schema.mjs";
|
|
6
|
+
import { AppInstallResponseSchema, AppInstallSchema, AppInstallTypeSchema, AppInstallsResponseSchema } from "./lib/modules/app-installs/schema.mjs";
|
|
7
|
+
import { ClientCreateRequestSchema, ClientResponseSchema, ClientSchema, ClientUpdateRequestSchema, ClientsResponseSchema } from "./lib/modules/clients/schema.mjs";
|
|
8
|
+
import { HexColorSchema } from "./schemas/shared/hex-color.mjs";
|
|
9
|
+
import { CompaniesResponseSchema, CompanyCreateRequestSchema, CompanyResponseSchema, CompanySchema, CompanyUpdateRequestSchema } from "./lib/modules/companies/schema.mjs";
|
|
10
|
+
import { ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema } from "./lib/modules/contract-templates/schema.mjs";
|
|
11
|
+
import { ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractsResponseSchema } from "./lib/modules/contracts/schema.mjs";
|
|
12
|
+
import { CustomFieldOptionSchema, ListCustomFieldOptionResponseSchema } from "./lib/modules/custom-field-options/schema.mjs";
|
|
13
|
+
import { AddressValueSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, ListCustomFieldResponseSchema } from "./lib/modules/custom-fields/schema.mjs";
|
|
14
|
+
import { AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema } from "./lib/modules/events/schema.mjs";
|
|
15
|
+
import { FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema } from "./lib/modules/file-channels/schema.mjs";
|
|
16
|
+
import { AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, FileTypeSchema } from "./lib/modules/files/schema.mjs";
|
|
17
|
+
import { FormResponseCreateRequestSchema, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponseSchema } from "./lib/modules/form-responses/schema.mjs";
|
|
18
|
+
import { FormDataResponseSchema, FormSchema, FormsDataResponseSchema } from "./lib/modules/forms/schema.mjs";
|
|
19
|
+
import { InternalUserResponseSchema, InternalUserSchema, InternalUsersResponseSchema } from "./lib/modules/internal-users/schema.mjs";
|
|
20
|
+
import { InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponseSchema } from "./lib/modules/invoice-templates/schema.mjs";
|
|
21
|
+
import { InvoiceCreateRequestSchema, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponseSchema, InvoiceSchema, InvoiceStatusSchema, InvoicesResponseSchema, PaymentMethodPreferenceSchema, PaymentMethodTypeSchema } from "./lib/modules/invoices/schema.mjs";
|
|
22
|
+
import { MessageChannelCreateRequestSchema, MessageChannelResponseSchema, MessageChannelSchema, MessageChannelsResponseSchema } from "./lib/modules/message-channels/schema.mjs";
|
|
23
|
+
import { MessageResponseSchema, MessageSchema, MessagesResponseSchema, SendMessageRequestSchema } from "./lib/modules/messages/schema.mjs";
|
|
24
|
+
import { NoteCreateRequestSchema, NoteResponseSchema, NoteSchema, NoteUpdateRequestSchema, NotesResponseSchema } from "./lib/modules/notes/schema.mjs";
|
|
25
|
+
import { EmailDeliveryTargetSchema, InProductDeliveryTargetSchema, NotificationCreateRequestSchema, NotificationDeliveryTargetsSchema, NotificationResponseSchema, NotificationSchema, NotificationsResponseSchema } from "./lib/modules/notifications/schema.mjs";
|
|
26
|
+
import { PaymentResponseSchema, PaymentSchema, PaymentsResponseSchema } from "./lib/modules/payments/schema.mjs";
|
|
27
|
+
import { PriceResponseSchema, PriceSchema, PricesResponseSchema } from "./lib/modules/prices/schema.mjs";
|
|
28
|
+
import { ProductResponseSchema, ProductSchema, ProductsResponseSchema } from "./lib/modules/products/schema.mjs";
|
|
29
|
+
import { SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponseSchema } from "./lib/modules/subscription-templates/schema.mjs";
|
|
30
|
+
import { SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponseSchema } from "./lib/modules/subscriptions/schema.mjs";
|
|
31
|
+
import { TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema } from "./lib/modules/task-templates/schema.mjs";
|
|
32
|
+
import { TaskCreateRequestSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskUpdateRequestSchema, TasksResponseSchema } from "./lib/modules/tasks/schema.mjs";
|
|
33
|
+
import { WorkspaceResponseSchema, WorkspaceSchema } from "./lib/modules/workspace/schema.mjs";
|
|
34
|
+
import { AssemblyInvalidTokenError } from "./errors/invalid-token.mjs";
|
|
35
|
+
import { AssemblyUnauthorizedError } from "./errors/unauthorized.mjs";
|
|
36
|
+
import { TokenPayloadSchema } from "./schemas/shared/token.mjs";
|
|
37
|
+
import { createToken } from "./token/parse.mjs";
|
|
38
|
+
import { AssemblyToken } from "./token/assembly-token.mjs";
|
|
39
|
+
import { AssemblyConnectionError } from "./errors/connection.mjs";
|
|
40
|
+
import { AssemblyForbiddenError } from "./errors/forbidden.mjs";
|
|
41
|
+
import { AssemblyNotFoundError } from "./errors/not-found.mjs";
|
|
42
|
+
import { AssemblyRateLimitError } from "./errors/rate-limit.mjs";
|
|
43
|
+
import { AssemblyServerError } from "./errors/server.mjs";
|
|
44
|
+
import { AssemblyValidationError } from "./errors/validation.mjs";
|
|
45
|
+
import { KitMode } from "./constants/kit-mode.mjs";
|
|
46
|
+
import { AssemblyKit, createAssemblyKit } from "./client/index.mjs";
|
|
47
|
+
import { AssemblyMissingApiKeyError } from "./errors/missing-api-key.mjs";
|
|
48
|
+
import "./errors/index.mjs";
|
|
49
|
+
import "./schemas/index.mjs";
|
|
50
|
+
import "./token/index.mjs";
|
|
51
|
+
export { AddressValueSchema, AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema, AppInstallResponseSchema, AppInstallSchema, AppInstallTypeSchema, AppInstallsResponseSchema, AssemblyConnectionError, AssemblyError, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, AssemblyForbiddenError, AssemblyInvalidTokenError, AssemblyKit, AssemblyMissingApiKeyError, AssemblyNoTokenError, AssemblyNotFoundError, AssemblyRateLimitError, AssemblyResponseParseError, AssemblyServerError, AssemblyToken, AssemblyUnauthorizedError, AssemblyValidationError, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, ClientCreateRequestSchema, ClientResponseSchema, ClientSchema, ClientUpdateRequestSchema, ClientsResponseSchema, CompaniesResponseSchema, CompanyCreateRequestSchema, CompanyResponseSchema, CompanySchema, CompanyUpdateRequestSchema, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema, ContractsResponseSchema, CustomFieldEntityTypeSchema, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, EmailDeliveryTargetSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema, FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema, FileTypeSchema, FormDataResponseSchema, FormResponseCreateRequestSchema, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponseSchema, FormSchema, FormsDataResponseSchema, HexColorSchema, InProductDeliveryTargetSchema, InternalUserResponseSchema, InternalUserSchema, InternalUsersResponseSchema, InvoiceCreateRequestSchema, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponseSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponseSchema, InvoicesResponseSchema, KitMode, ListCustomFieldOptionResponseSchema, ListCustomFieldResponseSchema, MembershipTypeSchema, MessageChannelCreateRequestSchema, MessageChannelResponseSchema, MessageChannelSchema, MessageChannelsResponseSchema, MessageResponseSchema, MessageSchema, MessagesResponseSchema, NoteCreateRequestSchema, NoteResponseSchema, NoteSchema, NoteUpdateRequestSchema, NotesResponseSchema, NotificationCreateRequestSchema, NotificationDeliveryTargetsSchema, NotificationResponseSchema, NotificationSchema, NotificationsResponseSchema, PaymentMethodPreferenceSchema, PaymentMethodTypeSchema, PaymentResponseSchema, PaymentSchema, PaymentsResponseSchema, PriceResponseSchema, PriceSchema, PricesResponseSchema, ProductResponseSchema, ProductSchema, ProductsResponseSchema, SendMessageRequestSchema, SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponseSchema, SubscriptionsResponseSchema, TaskCreateRequestSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema, TaskUpdateRequestSchema, TasksResponseSchema, TokenPayloadSchema, WorkspaceResponseSchema, WorkspaceSchema, createAssemblyKit, createToken };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Transport } from "../../../transport/http.mjs";
|
|
2
|
+
import { AppConnection, AppConnectionCreateRequest, AppConnectionsResponse } from "./schema.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/modules/app-connections/resource.d.ts
|
|
5
|
+
declare class AppConnectionsResource {
|
|
6
|
+
#private;
|
|
7
|
+
constructor({
|
|
8
|
+
transport,
|
|
9
|
+
validateResponses
|
|
10
|
+
}: {
|
|
11
|
+
transport: Transport;
|
|
12
|
+
validateResponses: boolean;
|
|
13
|
+
});
|
|
14
|
+
/** List app connections for an install. */
|
|
15
|
+
list(args: {
|
|
16
|
+
installId: string;
|
|
17
|
+
clientId?: string;
|
|
18
|
+
companyId?: string;
|
|
19
|
+
}): Promise<AppConnectionsResponse>;
|
|
20
|
+
/** Create an app connection for a manual app install. */
|
|
21
|
+
create(args: {
|
|
22
|
+
installId: string;
|
|
23
|
+
body: AppConnectionCreateRequest;
|
|
24
|
+
}): Promise<AppConnection>;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { AppConnectionsResource };
|
|
28
|
+
//# sourceMappingURL=resource.d.mts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { buildSearchParams } from "../../../transport/build-search-params.mjs";
|
|
2
|
+
import { parseResponse } from "../../../transport/parse-response.mjs";
|
|
3
|
+
import { AppConnectionResponseSchema, AppConnectionsResponseSchema } from "./schema.mjs";
|
|
4
|
+
//#region src/lib/modules/app-connections/resource.ts
|
|
5
|
+
var AppConnectionsResource = class {
|
|
6
|
+
#transport;
|
|
7
|
+
#validate;
|
|
8
|
+
constructor({ transport, validateResponses }) {
|
|
9
|
+
this.#transport = transport;
|
|
10
|
+
this.#validate = validateResponses;
|
|
11
|
+
}
|
|
12
|
+
/** List app connections for an install. */
|
|
13
|
+
async list(args) {
|
|
14
|
+
const { installId, ...filters } = args;
|
|
15
|
+
return parseResponse({
|
|
16
|
+
schema: AppConnectionsResponseSchema,
|
|
17
|
+
data: await this.#transport.get(`v1/installs/${installId}/connections`, { searchParams: buildSearchParams(filters) }),
|
|
18
|
+
validate: this.#validate
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Create an app connection for a manual app install. */
|
|
22
|
+
async create(args) {
|
|
23
|
+
return parseResponse({
|
|
24
|
+
schema: AppConnectionResponseSchema,
|
|
25
|
+
data: await this.#transport.post(`v1/installs/${args.installId}/connections`, args.body),
|
|
26
|
+
validate: this.#validate
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { AppConnectionsResource };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=resource.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.mjs","names":["#transport","#validate"],"sources":["../../../../src/lib/modules/app-connections/resource.ts"],"sourcesContent":["import { buildSearchParams } from \"src/transport/build-search-params\";\nimport type { Transport } from \"src/transport/http\";\nimport { parseResponse } from \"src/transport/parse-response\";\n\nimport { AppConnectionResponseSchema, AppConnectionsResponseSchema } from \"./schema\";\nimport type { AppConnection, AppConnectionCreateRequest, AppConnectionsResponse } from \"./schema\";\n\nexport class AppConnectionsResource {\n readonly #transport: Transport;\n readonly #validate: boolean;\n\n constructor({\n transport,\n validateResponses,\n }: {\n transport: Transport;\n validateResponses: boolean;\n }) {\n this.#transport = transport;\n this.#validate = validateResponses;\n }\n\n /** List app connections for an install. */\n async list(args: {\n installId: string;\n clientId?: string;\n companyId?: string;\n }): Promise<AppConnectionsResponse> {\n const { installId, ...filters } = args;\n const raw: unknown = await this.#transport.get(`v1/installs/${installId}/connections`, {\n searchParams: buildSearchParams(filters),\n });\n return parseResponse({\n schema: AppConnectionsResponseSchema,\n data: raw,\n validate: this.#validate,\n });\n }\n\n /** Create an app connection for a manual app install. */\n async create(args: {\n installId: string;\n body: AppConnectionCreateRequest;\n }): Promise<AppConnection> {\n const raw: unknown = await this.#transport.post(\n `v1/installs/${args.installId}/connections`,\n args.body,\n );\n return parseResponse({\n schema: AppConnectionResponseSchema,\n data: raw,\n validate: this.#validate,\n });\n }\n}\n"],"mappings":";;;;AAOA,IAAa,yBAAb,MAAoC;CAClC;CACA;CAEA,YAAY,EACV,WACA,qBAIC;AACD,QAAA,YAAkB;AAClB,QAAA,WAAiB;;;CAInB,MAAM,KAAK,MAIyB;EAClC,MAAM,EAAE,WAAW,GAAG,YAAY;AAIlC,SAAO,cAAc;GACnB,QAAQ;GACR,MAAM,MALmB,MAAA,UAAgB,IAAI,eAAe,UAAU,eAAe,EACrF,cAAc,kBAAkB,QAAQ,EACzC,CAAC;GAIA,UAAU,MAAA;GACX,CAAC;;;CAIJ,MAAM,OAAO,MAGc;AAKzB,SAAO,cAAc;GACnB,QAAQ;GACR,MAAM,MANmB,MAAA,UAAgB,KACzC,eAAe,KAAK,UAAU,eAC9B,KAAK,KACN;GAIC,UAAU,MAAA;GACX,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MembershipType } from "../../../schemas/shared/membership-type.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/modules/app-connections/schema.d.ts
|
|
5
|
+
type AppConnectionType = "embed" | "link";
|
|
6
|
+
declare const AppConnectionTypeSchema: z.ZodType<AppConnectionType>;
|
|
7
|
+
interface AppConnection {
|
|
8
|
+
clientIds?: string[] | null;
|
|
9
|
+
companyId?: string | null;
|
|
10
|
+
content?: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
id: string;
|
|
13
|
+
installId?: string;
|
|
14
|
+
membershipType?: MembershipType;
|
|
15
|
+
object: "appConnection";
|
|
16
|
+
type?: AppConnectionType;
|
|
17
|
+
updatedAt?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const AppConnectionSchema: z.ZodType<AppConnection>;
|
|
20
|
+
declare const AppConnectionResponseSchema: z.ZodType<AppConnection>;
|
|
21
|
+
type AppConnectionResponse = AppConnection;
|
|
22
|
+
interface AppConnectionsResponse {
|
|
23
|
+
data: AppConnection[] | null;
|
|
24
|
+
}
|
|
25
|
+
declare const AppConnectionsResponseSchema: z.ZodType<AppConnectionsResponse>;
|
|
26
|
+
interface AppConnectionCreateRequest {
|
|
27
|
+
clientIds?: string[];
|
|
28
|
+
companyId?: string;
|
|
29
|
+
content: string;
|
|
30
|
+
installId: string;
|
|
31
|
+
membershipType: MembershipType;
|
|
32
|
+
type: AppConnectionType;
|
|
33
|
+
}
|
|
34
|
+
declare const AppConnectionCreateRequestSchema: z.ZodType<AppConnectionCreateRequest>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema };
|
|
37
|
+
//# sourceMappingURL=schema.d.mts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MembershipTypeSchema } from "../../../schemas/shared/membership-type.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/lib/modules/app-connections/schema.ts
|
|
4
|
+
const AppConnectionTypeSchema = z.enum(["embed", "link"]);
|
|
5
|
+
const AppConnectionSchema = z.object({
|
|
6
|
+
clientIds: z.array(z.string()).nullable().optional(),
|
|
7
|
+
companyId: z.string().nullable().optional(),
|
|
8
|
+
content: z.string().optional(),
|
|
9
|
+
createdAt: z.iso.datetime(),
|
|
10
|
+
id: z.string(),
|
|
11
|
+
installId: z.string().optional(),
|
|
12
|
+
membershipType: MembershipTypeSchema.optional(),
|
|
13
|
+
object: z.literal("appConnection"),
|
|
14
|
+
type: AppConnectionTypeSchema.optional(),
|
|
15
|
+
updatedAt: z.iso.datetime().optional()
|
|
16
|
+
});
|
|
17
|
+
const AppConnectionResponseSchema = AppConnectionSchema;
|
|
18
|
+
const AppConnectionsResponseSchema = z.object({ data: z.array(AppConnectionSchema).nullable() });
|
|
19
|
+
const AppConnectionCreateRequestSchema = z.object({
|
|
20
|
+
clientIds: z.array(z.string()).optional(),
|
|
21
|
+
companyId: z.string().optional(),
|
|
22
|
+
content: z.string(),
|
|
23
|
+
installId: z.string(),
|
|
24
|
+
membershipType: MembershipTypeSchema,
|
|
25
|
+
type: AppConnectionTypeSchema
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/lib/modules/app-connections/schema.ts"],"sourcesContent":["import type { MembershipType } from \"src/schemas/shared/membership-type\";\nimport { MembershipTypeSchema } from \"src/schemas/shared/membership-type\";\nimport { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Base types\n// ---------------------------------------------------------------------------\n\nexport type AppConnectionType = \"embed\" | \"link\";\n\nexport const AppConnectionTypeSchema: z.ZodType<AppConnectionType> = z.enum([\"embed\", \"link\"]);\n\nexport interface AppConnection {\n clientIds?: string[] | null;\n companyId?: string | null;\n content?: string;\n createdAt: string;\n id: string;\n installId?: string;\n membershipType?: MembershipType;\n object: \"appConnection\";\n type?: AppConnectionType;\n updatedAt?: string;\n}\n\nexport const AppConnectionSchema: z.ZodType<AppConnection> = z.object({\n clientIds: z.array(z.string()).nullable().optional(),\n companyId: z.string().nullable().optional(),\n content: z.string().optional(),\n createdAt: z.iso.datetime(),\n id: z.string(),\n installId: z.string().optional(),\n membershipType: MembershipTypeSchema.optional(),\n object: z.literal(\"appConnection\"),\n type: AppConnectionTypeSchema.optional(),\n updatedAt: z.iso.datetime().optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Response types\n// ---------------------------------------------------------------------------\n\nexport const AppConnectionResponseSchema: z.ZodType<AppConnection> = AppConnectionSchema;\nexport type AppConnectionResponse = AppConnection;\n\nexport interface AppConnectionsResponse {\n data: AppConnection[] | null;\n}\n\nexport const AppConnectionsResponseSchema: z.ZodType<AppConnectionsResponse> = z.object({\n data: z.array(AppConnectionSchema).nullable(),\n});\n\n// ---------------------------------------------------------------------------\n// Request types\n// ---------------------------------------------------------------------------\n\nexport interface AppConnectionCreateRequest {\n clientIds?: string[];\n companyId?: string;\n content: string;\n installId: string;\n membershipType: MembershipType;\n type: AppConnectionType;\n}\n\nexport const AppConnectionCreateRequestSchema: z.ZodType<AppConnectionCreateRequest> = z.object({\n clientIds: z.array(z.string()).optional(),\n companyId: z.string().optional(),\n content: z.string(),\n installId: z.string(),\n membershipType: MembershipTypeSchema,\n type: AppConnectionTypeSchema,\n});\n"],"mappings":";;;AAUA,MAAa,0BAAwD,EAAE,KAAK,CAAC,SAAS,OAAO,CAAC;AAe9F,MAAa,sBAAgD,EAAE,OAAO;CACpE,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,UAAU;CACpD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC3C,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,WAAW,EAAE,IAAI,UAAU;CAC3B,IAAI,EAAE,QAAQ;CACd,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,gBAAgB,qBAAqB,UAAU;CAC/C,QAAQ,EAAE,QAAQ,gBAAgB;CAClC,MAAM,wBAAwB,UAAU;CACxC,WAAW,EAAE,IAAI,UAAU,CAAC,UAAU;CACvC,CAAC;AAMF,MAAa,8BAAwD;AAOrE,MAAa,+BAAkE,EAAE,OAAO,EACtF,MAAM,EAAE,MAAM,oBAAoB,CAAC,UAAU,EAC9C,CAAC;AAeF,MAAa,mCAA0E,EAAE,OAAO;CAC9F,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACzC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,SAAS,EAAE,QAAQ;CACnB,WAAW,EAAE,QAAQ;CACrB,gBAAgB;CAChB,MAAM;CACP,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Transport } from "../../../transport/http.mjs";
|
|
2
|
+
import { AppInstall, AppInstallsResponse } from "./schema.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/modules/app-installs/resource.d.ts
|
|
5
|
+
declare class AppInstallsResource {
|
|
6
|
+
#private;
|
|
7
|
+
constructor({
|
|
8
|
+
transport,
|
|
9
|
+
validateResponses
|
|
10
|
+
}: {
|
|
11
|
+
transport: Transport;
|
|
12
|
+
validateResponses: boolean;
|
|
13
|
+
});
|
|
14
|
+
/** List all app installs. */
|
|
15
|
+
list(): Promise<AppInstallsResponse>;
|
|
16
|
+
/** Retrieve a single app install by ID. */
|
|
17
|
+
retrieve(installId: string): Promise<AppInstall>;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AppInstallsResource };
|
|
21
|
+
//# sourceMappingURL=resource.d.mts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { parseResponse } from "../../../transport/parse-response.mjs";
|
|
2
|
+
import { AppInstallResponseSchema, AppInstallsResponseSchema } from "./schema.mjs";
|
|
3
|
+
//#region src/lib/modules/app-installs/resource.ts
|
|
4
|
+
var AppInstallsResource = class {
|
|
5
|
+
#transport;
|
|
6
|
+
#validate;
|
|
7
|
+
constructor({ transport, validateResponses }) {
|
|
8
|
+
this.#transport = transport;
|
|
9
|
+
this.#validate = validateResponses;
|
|
10
|
+
}
|
|
11
|
+
/** List all app installs. */
|
|
12
|
+
async list() {
|
|
13
|
+
return parseResponse({
|
|
14
|
+
schema: AppInstallsResponseSchema,
|
|
15
|
+
data: await this.#transport.get("v1/installs"),
|
|
16
|
+
validate: this.#validate
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Retrieve a single app install by ID. */
|
|
20
|
+
async retrieve(installId) {
|
|
21
|
+
return parseResponse({
|
|
22
|
+
schema: AppInstallResponseSchema,
|
|
23
|
+
data: await this.#transport.get(`v1/installs/${installId}`),
|
|
24
|
+
validate: this.#validate
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { AppInstallsResource };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=resource.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.mjs","names":["#transport","#validate"],"sources":["../../../../src/lib/modules/app-installs/resource.ts"],"sourcesContent":["import type { Transport } from \"src/transport/http\";\nimport { parseResponse } from \"src/transport/parse-response\";\n\nimport { AppInstallResponseSchema, AppInstallsResponseSchema } from \"./schema\";\nimport type { AppInstall, AppInstallsResponse } from \"./schema\";\n\nexport class AppInstallsResource {\n readonly #transport: Transport;\n readonly #validate: boolean;\n\n constructor({\n transport,\n validateResponses,\n }: {\n transport: Transport;\n validateResponses: boolean;\n }) {\n this.#transport = transport;\n this.#validate = validateResponses;\n }\n\n /** List all app installs. */\n async list(): Promise<AppInstallsResponse> {\n const raw: unknown = await this.#transport.get(\"v1/installs\");\n return parseResponse({\n schema: AppInstallsResponseSchema,\n data: raw,\n validate: this.#validate,\n });\n }\n\n /** Retrieve a single app install by ID. */\n async retrieve(installId: string): Promise<AppInstall> {\n const raw: unknown = await this.#transport.get(`v1/installs/${installId}`);\n return parseResponse({ schema: AppInstallResponseSchema, data: raw, validate: this.#validate });\n }\n}\n"],"mappings":";;;AAMA,IAAa,sBAAb,MAAiC;CAC/B;CACA;CAEA,YAAY,EACV,WACA,qBAIC;AACD,QAAA,YAAkB;AAClB,QAAA,WAAiB;;;CAInB,MAAM,OAAqC;AAEzC,SAAO,cAAc;GACnB,QAAQ;GACR,MAAM,MAHmB,MAAA,UAAgB,IAAI,cAAc;GAI3D,UAAU,MAAA;GACX,CAAC;;;CAIJ,MAAM,SAAS,WAAwC;AAErD,SAAO,cAAc;GAAE,QAAQ;GAA0B,MAAM,MADpC,MAAA,UAAgB,IAAI,eAAe,YAAY;GACN,UAAU,MAAA;GAAgB,CAAC"}
|