assembly-kit 0.0.5 → 0.1.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/CLAUDE.md +18 -0
- package/README.md +26 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib/modules/custom-fields/schema.d.mts +12 -2
- package/dist/lib/modules/custom-fields/schema.mjs +8 -3
- package/dist/lib/modules/custom-fields/schema.mjs.map +1 -1
- package/dist/lib/modules/index.d.mts +2 -2
- package/dist/lib/modules/tasks/schema.d.mts +36 -13
- package/dist/lib/modules/tasks/schema.mjs +34 -13
- package/dist/lib/modules/tasks/schema.mjs.map +1 -1
- package/dist/schemas/index.d.mts +3 -3
- package/dist/schemas/index.mjs +3 -3
- package/dist/token/assembly-token.d.mts +6 -0
- package/dist/token/assembly-token.mjs +8 -0
- package/dist/token/assembly-token.mjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +1 -3
package/CLAUDE.md
CHANGED
|
@@ -91,6 +91,23 @@ if (page.nextToken) {
|
|
|
91
91
|
}
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
## Task Assignment Email
|
|
95
|
+
|
|
96
|
+
`tasks.create()` takes an optional `email` (`subject`, `header`, `title`, plus `body` or `htmlBody`, optional `ctaParams`) that replaces the default assignment email:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
await kit.tasks.create({
|
|
100
|
+
name: "Review your evaluation",
|
|
101
|
+
companyId: "co-123",
|
|
102
|
+
email: {
|
|
103
|
+
subject: "Ready",
|
|
104
|
+
header: "Evaluation complete",
|
|
105
|
+
title: "Review",
|
|
106
|
+
htmlBody: "<p>Hi</p>",
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
94
111
|
## Typed Custom Fields
|
|
95
112
|
|
|
96
113
|
`createAssemblyKit` accepts optional generic parameters that type the
|
|
@@ -126,6 +143,7 @@ token.companyId; // string | undefined
|
|
|
126
143
|
token.internalUserId; // string | undefined
|
|
127
144
|
token.isClientUser; // boolean
|
|
128
145
|
token.isInternalUser; // boolean
|
|
146
|
+
token.isProxying; // boolean — internal user previewing as a client (both IDs present)
|
|
129
147
|
|
|
130
148
|
const client = token.ensureIsClient(); // ClientTokenPayload (throws if not client)
|
|
131
149
|
const internal = token.ensureIsInternalUser(); // InternalUserTokenPayload (throws if not internal)
|
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ const kit = createAssemblyKit({
|
|
|
36
36
|
// Access resources via namespaces
|
|
37
37
|
const workspace = await kit.workspace.retrieve();
|
|
38
38
|
const companies = await kit.companies.list();
|
|
39
|
-
const task = await kit.tasks.create({
|
|
39
|
+
const task = await kit.tasks.create({ name: "Follow up", ... });
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
When only `workspaceId` is provided (no token), the SDK automatically sets `ASSEMBLY_ENV=local` at runtime and builds the compound key as `workspaceId/apiKey`.
|
|
@@ -179,6 +179,24 @@ const kit = createAssemblyKit({
|
|
|
179
179
|
rather than JSON. Use `files.retrieveDownloadUrl()` instead when you want a presigned URL to
|
|
180
180
|
hand to a browser.
|
|
181
181
|
|
|
182
|
+
`tasks.create()` accepts an optional `email` to replace the default assignment email the
|
|
183
|
+
assignee receives. `htmlBody` supports only `p`, `br`, `strong`/`b`, `em`/`i`, `ul`, `ol`,
|
|
184
|
+
`li` and https links.
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
await kit.tasks.create({
|
|
188
|
+
name: "Review your evaluation",
|
|
189
|
+
companyId: "co-123",
|
|
190
|
+
status: "todo",
|
|
191
|
+
email: {
|
|
192
|
+
subject: "Your evaluation is ready",
|
|
193
|
+
header: "Evaluation complete",
|
|
194
|
+
title: "Review Evaluation",
|
|
195
|
+
htmlBody: "<p>Your results are attached to the task.</p>",
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
182
200
|
### Pagination
|
|
183
201
|
|
|
184
202
|
Every resource that supports listing also exposes `listAll()`, which collects all pages into a single array by following `nextToken` cursors automatically:
|
|
@@ -289,6 +307,11 @@ import type {
|
|
|
289
307
|
} from "assembly-kit/schemas";
|
|
290
308
|
```
|
|
291
309
|
|
|
310
|
+
`customFields.create()` resolves to `CreatedCustomField[]`, not `CustomField[]`: `POST /v1/custom-fields`
|
|
311
|
+
omits `object` from the fields it echoes back, where `GET` includes it. Narrow it yourself if you need
|
|
312
|
+
the discriminant, or re-read the field through `customFields.list()`, which is authoritative for the
|
|
313
|
+
derived `key` anyway.
|
|
314
|
+
|
|
292
315
|
#### Response schemas
|
|
293
316
|
|
|
294
317
|
```typescript
|
|
@@ -358,8 +381,9 @@ token.tokenId; // string | undefined — present in some marketplace tokens
|
|
|
358
381
|
token.baseUrl; // string | undefined — overrides the API base URL if set
|
|
359
382
|
|
|
360
383
|
// Identity checks
|
|
361
|
-
token.isClientUser; // true if clientId
|
|
384
|
+
token.isClientUser; // true if clientId is present
|
|
362
385
|
token.isInternalUser; // true if internalUserId is present
|
|
386
|
+
token.isProxying; // true if BOTH are present — internal user previewing as a client via CRM
|
|
363
387
|
|
|
364
388
|
// Throwing guards — return narrowed payload type or throw AssemblyUnauthorizedError
|
|
365
389
|
const clientPayload = token.ensureIsClient(); // ClientTokenPayload
|
package/dist/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ import { CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientEr
|
|
|
7
7
|
import { ContractTemplate, ContractTemplateResponse, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponse, ContractTemplatesResponseSchema } from "./lib/modules/contract-templates/schema.mjs";
|
|
8
8
|
import { Contract, ContractField, ContractFieldInputType, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponse, ContractResponseSchema, ContractSchema, ContractSendRequest, ContractSendRequestSchema, ContractStatus, ContractStatusSchema, ContractsResponse, ContractsResponseSchema } from "./lib/modules/contracts/schema.mjs";
|
|
9
9
|
import { CustomFieldOption, CustomFieldOptionSchema, ListCustomFieldOptionResponse, ListCustomFieldOptionResponseSchema } from "./lib/modules/custom-field-options/schema.mjs";
|
|
10
|
-
import { AddressValue, AddressValueSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "./lib/modules/custom-fields/schema.mjs";
|
|
10
|
+
import { AddressValue, AddressValueSchema, CreatedCustomField, CreatedCustomFieldSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "./lib/modules/custom-fields/schema.mjs";
|
|
11
11
|
import { AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, ClientUserEventCreateRequest, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, InternalUserEventCreateRequest } from "./lib/modules/events/schema.mjs";
|
|
12
12
|
import { FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema } from "./lib/modules/file-channels/schema.mjs";
|
|
13
13
|
import { AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, ClientPermissions, ClientPermissionsSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema } from "./lib/modules/files/schema.mjs";
|
|
@@ -29,7 +29,7 @@ import { SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplat
|
|
|
29
29
|
import { Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponse, SubscriptionsResponseSchema } from "./lib/modules/subscriptions/schema.mjs";
|
|
30
30
|
import { TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema } from "./lib/modules/task-comments/schema.mjs";
|
|
31
31
|
import { TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema } from "./lib/modules/task-templates/schema.mjs";
|
|
32
|
-
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema } from "./lib/modules/tasks/schema.mjs";
|
|
32
|
+
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskEmail, TaskEmailSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TaskViewer, TaskViewerSchema, TasksResponse, TasksResponseSchema } from "./lib/modules/tasks/schema.mjs";
|
|
33
33
|
import { Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema } from "./lib/modules/workspace/schema.mjs";
|
|
34
34
|
import { TokenPayload, TokenPayloadSchema } from "./schemas/shared/token.mjs";
|
|
35
35
|
import { AssemblyToken, ClientTokenPayload, InternalUserTokenPayload } from "./token/assembly-token.mjs";
|
|
@@ -49,4 +49,4 @@ import { AssemblyServerError } from "./errors/server.mjs";
|
|
|
49
49
|
import { AssemblyUnauthorizedError } from "./errors/unauthorized.mjs";
|
|
50
50
|
import { AssemblyValidationError } from "./errors/validation.mjs";
|
|
51
51
|
import { createToken } from "./token/parse.mjs";
|
|
52
|
-
export { AddressValue, AddressValueSchema, AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema, AppInstall, AppInstallResponse, AppInstallResponseSchema, AppInstallSchema, AppInstallType, AppInstallTypeSchema, AppInstallsResponse, AppInstallsResponseSchema, AppNotificationActionLabel, AppNotificationActionLabelSchema, AppNotificationSetting, AppNotificationSettingSchema, AppNotificationSettingsCreateRequest, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponse, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequest, AppNotificationSettingsUpdateRequestSchema, 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, BillingPeriod, BillingPeriodSchema, Client, ClientCreateRequest, ClientCreateRequestSchema, ClientPermissions, ClientPermissionsSchema, ClientResponse, ClientResponseSchema, ClientSchema, ClientTokenPayload, ClientUpdateRequest, ClientUpdateRequestSchema, ClientUserEventCreateRequest, ClientWithAppVisibility, ClientWithAppVisibilitySchema, ClientsResponse, ClientsResponseSchema, CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientError, CompanyAddClientsRequest, CompanyAddClientsRequestSchema, CompanyAddClientsResponse, CompanyAddClientsResponseSchema, 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, CurrentUser, CurrentUserResponse, CurrentUserResponseSchema, CurrentUserSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldOption, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, EmailDeliveryTarget, EmailDeliveryTargetSchema, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema, Form, FormAdditionalFields, FormAdditionalFieldsSchema, FormCreateRequest, FormCreateRequestSchema, FormDataResponse, FormDataResponseSchema, FormField, FormFieldSchema, FormFieldType, FormFieldTypeSchema, FormFields, FormFieldsSchema, FormResponse, FormResponseCreateRequest, FormResponseCreateRequestSchema, FormResponseItemResponse, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponse, FormResponsesResponseSchema, FormSchema, FormVisibility, FormVisibilitySchema, FormsDataResponse, FormsDataResponseSchema, HexColor, HexColorSchema, InProductDeliveryTarget, InProductDeliveryTargetSchema, InternalUser, InternalUserEmailSetting, InternalUserEmailSettingSchema, InternalUserEventCreateRequest, InternalUserNotificationSettings, InternalUserNotificationSettingsSchema, InternalUserResponse, InternalUserResponseSchema, InternalUserSchema, InternalUserTokenPayload, InternalUserUpdateRequest, InternalUserUpdateRequestSchema, 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, NotificationCategorySetting, NotificationCategorySettingSchema, NotificationCreateRequest, NotificationCreateRequestSchema, NotificationDeliveryTargets, NotificationDeliveryTargetsSchema, NotificationResponse, NotificationResponseSchema, NotificationSchema, NotificationSurface, NotificationSurfaceSchema, NotificationsResponse, NotificationsResponseSchema, Payment, PaymentMethodPreference, PaymentMethodPreferenceSchema, PaymentMethodType, PaymentMethodTypeSchema, PaymentResponse, PaymentResponseSchema, PaymentSchema, PaymentsResponse, PaymentsResponseSchema, Price, PriceCreateRequest, PriceCreateRequestSchema, PriceResponse, PriceResponseSchema, PriceSchema, PriceType, PriceTypeSchema, PricesResponse, PricesResponseSchema, Product, ProductCreateRequest, ProductCreateRequestSchema, ProductResponse, ProductResponseSchema, ProductSchema, ProductsResponse, ProductsResponseSchema, Refund, RefundCreateRequest, RefundCreateRequestSchema, RefundResponse, RefundResponseSchema, RefundSchema, RefundStatus, RefundStatusSchema, RefundsResponse, RefundsResponseSchema, SendMessageRequest, SendMessageRequestSchema, Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponse, SubscriptionTemplatesResponseSchema, SubscriptionsResponse, SubscriptionsResponseSchema, Task, TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema, TokenPayload, TokenPayloadSchema, UnreadMessageChannelsResponse, UnreadMessageChannelsResponseSchema, Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema, createAssemblyKit, createToken };
|
|
52
|
+
export { AddressValue, AddressValueSchema, AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema, AppInstall, AppInstallResponse, AppInstallResponseSchema, AppInstallSchema, AppInstallType, AppInstallTypeSchema, AppInstallsResponse, AppInstallsResponseSchema, AppNotificationActionLabel, AppNotificationActionLabelSchema, AppNotificationSetting, AppNotificationSettingSchema, AppNotificationSettingsCreateRequest, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponse, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequest, AppNotificationSettingsUpdateRequestSchema, 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, BillingPeriod, BillingPeriodSchema, Client, ClientCreateRequest, ClientCreateRequestSchema, ClientPermissions, ClientPermissionsSchema, ClientResponse, ClientResponseSchema, ClientSchema, ClientTokenPayload, ClientUpdateRequest, ClientUpdateRequestSchema, ClientUserEventCreateRequest, ClientWithAppVisibility, ClientWithAppVisibilitySchema, ClientsResponse, ClientsResponseSchema, CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientError, CompanyAddClientsRequest, CompanyAddClientsRequestSchema, CompanyAddClientsResponse, CompanyAddClientsResponseSchema, 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, CreatedCustomField, CreatedCustomFieldSchema, CurrentUser, CurrentUserResponse, CurrentUserResponseSchema, CurrentUserSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldOption, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, EmailDeliveryTarget, EmailDeliveryTargetSchema, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema, Form, FormAdditionalFields, FormAdditionalFieldsSchema, FormCreateRequest, FormCreateRequestSchema, FormDataResponse, FormDataResponseSchema, FormField, FormFieldSchema, FormFieldType, FormFieldTypeSchema, FormFields, FormFieldsSchema, FormResponse, FormResponseCreateRequest, FormResponseCreateRequestSchema, FormResponseItemResponse, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponse, FormResponsesResponseSchema, FormSchema, FormVisibility, FormVisibilitySchema, FormsDataResponse, FormsDataResponseSchema, HexColor, HexColorSchema, InProductDeliveryTarget, InProductDeliveryTargetSchema, InternalUser, InternalUserEmailSetting, InternalUserEmailSettingSchema, InternalUserEventCreateRequest, InternalUserNotificationSettings, InternalUserNotificationSettingsSchema, InternalUserResponse, InternalUserResponseSchema, InternalUserSchema, InternalUserTokenPayload, InternalUserUpdateRequest, InternalUserUpdateRequestSchema, 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, NotificationCategorySetting, NotificationCategorySettingSchema, NotificationCreateRequest, NotificationCreateRequestSchema, NotificationDeliveryTargets, NotificationDeliveryTargetsSchema, NotificationResponse, NotificationResponseSchema, NotificationSchema, NotificationSurface, NotificationSurfaceSchema, NotificationsResponse, NotificationsResponseSchema, Payment, PaymentMethodPreference, PaymentMethodPreferenceSchema, PaymentMethodType, PaymentMethodTypeSchema, PaymentResponse, PaymentResponseSchema, PaymentSchema, PaymentsResponse, PaymentsResponseSchema, Price, PriceCreateRequest, PriceCreateRequestSchema, PriceResponse, PriceResponseSchema, PriceSchema, PriceType, PriceTypeSchema, PricesResponse, PricesResponseSchema, Product, ProductCreateRequest, ProductCreateRequestSchema, ProductResponse, ProductResponseSchema, ProductSchema, ProductsResponse, ProductsResponseSchema, Refund, RefundCreateRequest, RefundCreateRequestSchema, RefundResponse, RefundResponseSchema, RefundSchema, RefundStatus, RefundStatusSchema, RefundsResponse, RefundsResponseSchema, SendMessageRequest, SendMessageRequestSchema, Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponse, SubscriptionTemplatesResponseSchema, SubscriptionsResponse, SubscriptionsResponseSchema, Task, TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema, TaskCreateRequest, TaskCreateRequestSchema, TaskEmail, TaskEmailSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TaskViewer, TaskViewerSchema, TasksResponse, TasksResponseSchema, TokenPayload, TokenPayloadSchema, UnreadMessageChannelsResponse, UnreadMessageChannelsResponseSchema, Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema, createAssemblyKit, createToken };
|
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { CompaniesResponseSchema, CompanyAddClientsRequestSchema, CompanyAddClie
|
|
|
10
10
|
import { ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema } from "./lib/modules/contract-templates/schema.mjs";
|
|
11
11
|
import { ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractsResponseSchema } from "./lib/modules/contracts/schema.mjs";
|
|
12
12
|
import { CustomFieldOptionSchema, ListCustomFieldOptionResponseSchema } from "./lib/modules/custom-field-options/schema.mjs";
|
|
13
|
-
import { AddressValueSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, ListCustomFieldResponseSchema } from "./lib/modules/custom-fields/schema.mjs";
|
|
13
|
+
import { AddressValueSchema, CreatedCustomFieldSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, ListCustomFieldResponseSchema } from "./lib/modules/custom-fields/schema.mjs";
|
|
14
14
|
import { AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema } from "./lib/modules/events/schema.mjs";
|
|
15
15
|
import { FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema } from "./lib/modules/file-channels/schema.mjs";
|
|
16
16
|
import { AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, ClientPermissionsSchema, FileDownloadUrlResponseSchema, FilePermissionsResponseSchema, FileTypeSchema } from "./lib/modules/files/schema.mjs";
|
|
@@ -32,7 +32,7 @@ import { SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, Subscri
|
|
|
32
32
|
import { SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponseSchema } from "./lib/modules/subscriptions/schema.mjs";
|
|
33
33
|
import { TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponseSchema } from "./lib/modules/task-comments/schema.mjs";
|
|
34
34
|
import { TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema } from "./lib/modules/task-templates/schema.mjs";
|
|
35
|
-
import { TaskCreateRequestSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskUpdateRequestSchema, TasksResponseSchema } from "./lib/modules/tasks/schema.mjs";
|
|
35
|
+
import { TaskCreateRequestSchema, TaskEmailSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskUpdateRequestSchema, TaskViewerSchema, TasksResponseSchema } from "./lib/modules/tasks/schema.mjs";
|
|
36
36
|
import { WorkspaceResponseSchema, WorkspaceSchema } from "./lib/modules/workspace/schema.mjs";
|
|
37
37
|
import { AssemblyInvalidTokenError } from "./errors/invalid-token.mjs";
|
|
38
38
|
import { AssemblyUnauthorizedError } from "./errors/unauthorized.mjs";
|
|
@@ -51,4 +51,4 @@ import { AssemblyMissingApiKeyError } from "./errors/missing-api-key.mjs";
|
|
|
51
51
|
import "./errors/index.mjs";
|
|
52
52
|
import "./schemas/index.mjs";
|
|
53
53
|
import "./token/index.mjs";
|
|
54
|
-
export { AddressValueSchema, AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema, AppInstallResponseSchema, AppInstallSchema, AppInstallTypeSchema, AppInstallsResponseSchema, AppNotificationActionLabelSchema, AppNotificationSettingSchema, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequestSchema, AssemblyConnectionError, AssemblyError, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, AssemblyForbiddenError, AssemblyInvalidTokenError, AssemblyKit, AssemblyMissingApiKeyError, AssemblyNoTokenError, AssemblyNotFoundError, AssemblyRateLimitError, AssemblyResponseParseError, AssemblyServerError, AssemblyToken, AssemblyUnauthorizedError, AssemblyValidationError, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, BillingPeriodSchema, ClientCreateRequestSchema, ClientPermissionsSchema, ClientResponseSchema, ClientSchema, ClientUpdateRequestSchema, ClientWithAppVisibilitySchema, ClientsResponseSchema, CompaniesResponseSchema, CompanyAddClientsRequestSchema, CompanyAddClientsResponseSchema, CompanyCreateRequestSchema, CompanyResponseSchema, CompanySchema, CompanyUpdateRequestSchema, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema, ContractsResponseSchema, CurrentUserResponseSchema, CurrentUserSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, EmailDeliveryTargetSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema, FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema, FileDownloadUrlResponseSchema, FilePermissionsResponseSchema, FileTypeSchema, FormAdditionalFieldsSchema, FormCreateRequestSchema, FormDataResponseSchema, FormFieldSchema, FormFieldTypeSchema, FormFieldsSchema, FormResponseCreateRequestSchema, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponseSchema, FormSchema, FormVisibilitySchema, FormsDataResponseSchema, HexColorSchema, InProductDeliveryTargetSchema, InternalUserEmailSettingSchema, InternalUserNotificationSettingsSchema, InternalUserResponseSchema, InternalUserSchema, InternalUserUpdateRequestSchema, 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, NotificationCategorySettingSchema, NotificationCreateRequestSchema, NotificationDeliveryTargetsSchema, NotificationResponseSchema, NotificationSchema, NotificationSurfaceSchema, NotificationsResponseSchema, PaymentMethodPreferenceSchema, PaymentMethodTypeSchema, PaymentResponseSchema, PaymentSchema, PaymentsResponseSchema, PriceCreateRequestSchema, PriceResponseSchema, PriceSchema, PriceTypeSchema, PricesResponseSchema, ProductCreateRequestSchema, ProductResponseSchema, ProductSchema, ProductsResponseSchema, RefundCreateRequestSchema, RefundResponseSchema, RefundSchema, RefundStatusSchema, RefundsResponseSchema, SendMessageRequestSchema, SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponseSchema, SubscriptionsResponseSchema, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponseSchema, TaskCreateRequestSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema, TaskUpdateRequestSchema, TasksResponseSchema, TokenPayloadSchema, UnreadMessageChannelsResponseSchema, WorkspaceResponseSchema, WorkspaceSchema, createAssemblyKit, createToken };
|
|
54
|
+
export { AddressValueSchema, AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema, AppInstallResponseSchema, AppInstallSchema, AppInstallTypeSchema, AppInstallsResponseSchema, AppNotificationActionLabelSchema, AppNotificationSettingSchema, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequestSchema, AssemblyConnectionError, AssemblyError, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, AssemblyForbiddenError, AssemblyInvalidTokenError, AssemblyKit, AssemblyMissingApiKeyError, AssemblyNoTokenError, AssemblyNotFoundError, AssemblyRateLimitError, AssemblyResponseParseError, AssemblyServerError, AssemblyToken, AssemblyUnauthorizedError, AssemblyValidationError, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, BillingPeriodSchema, ClientCreateRequestSchema, ClientPermissionsSchema, ClientResponseSchema, ClientSchema, ClientUpdateRequestSchema, ClientWithAppVisibilitySchema, ClientsResponseSchema, CompaniesResponseSchema, CompanyAddClientsRequestSchema, CompanyAddClientsResponseSchema, CompanyCreateRequestSchema, CompanyResponseSchema, CompanySchema, CompanyUpdateRequestSchema, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema, ContractsResponseSchema, CreatedCustomFieldSchema, CurrentUserResponseSchema, CurrentUserSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, EmailDeliveryTargetSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema, FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema, FileDownloadUrlResponseSchema, FilePermissionsResponseSchema, FileTypeSchema, FormAdditionalFieldsSchema, FormCreateRequestSchema, FormDataResponseSchema, FormFieldSchema, FormFieldTypeSchema, FormFieldsSchema, FormResponseCreateRequestSchema, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponseSchema, FormSchema, FormVisibilitySchema, FormsDataResponseSchema, HexColorSchema, InProductDeliveryTargetSchema, InternalUserEmailSettingSchema, InternalUserNotificationSettingsSchema, InternalUserResponseSchema, InternalUserSchema, InternalUserUpdateRequestSchema, 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, NotificationCategorySettingSchema, NotificationCreateRequestSchema, NotificationDeliveryTargetsSchema, NotificationResponseSchema, NotificationSchema, NotificationSurfaceSchema, NotificationsResponseSchema, PaymentMethodPreferenceSchema, PaymentMethodTypeSchema, PaymentResponseSchema, PaymentSchema, PaymentsResponseSchema, PriceCreateRequestSchema, PriceResponseSchema, PriceSchema, PriceTypeSchema, PricesResponseSchema, ProductCreateRequestSchema, ProductResponseSchema, ProductSchema, ProductsResponseSchema, RefundCreateRequestSchema, RefundResponseSchema, RefundSchema, RefundStatusSchema, RefundsResponseSchema, SendMessageRequestSchema, SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponseSchema, SubscriptionsResponseSchema, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponseSchema, TaskCreateRequestSchema, TaskEmailSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema, TaskUpdateRequestSchema, TaskViewerSchema, TasksResponseSchema, TokenPayloadSchema, UnreadMessageChannelsResponseSchema, WorkspaceResponseSchema, WorkspaceSchema, createAssemblyKit, createToken };
|
|
@@ -17,6 +17,16 @@ interface CustomField {
|
|
|
17
17
|
type: CustomFieldType;
|
|
18
18
|
}
|
|
19
19
|
declare const CustomFieldSchema: z.ZodType<CustomField>;
|
|
20
|
+
/**
|
|
21
|
+
* `POST /v1/custom-fields` omits `object` from the fields it echoes back, though `GET` includes it
|
|
22
|
+
* and the API reference documents it on both. Requiring it made a successful create throw
|
|
23
|
+
* `AssemblyResponseParseError` after the field had been created — and a custom field cannot be
|
|
24
|
+
* deleted through the API, so a retry left a duplicate behind. Drop this once the API sends it.
|
|
25
|
+
*/
|
|
26
|
+
interface CreatedCustomField extends Omit<CustomField, "object"> {
|
|
27
|
+
object?: "customField";
|
|
28
|
+
}
|
|
29
|
+
declare const CreatedCustomFieldSchema: z.ZodType<CreatedCustomField>;
|
|
20
30
|
interface AddressValue {
|
|
21
31
|
addressLine1?: string;
|
|
22
32
|
addressLine2?: string;
|
|
@@ -53,9 +63,9 @@ interface CustomFieldsCreateRequest {
|
|
|
53
63
|
}
|
|
54
64
|
declare const CustomFieldsCreateRequestSchema: z.ZodType<CustomFieldsCreateRequest>;
|
|
55
65
|
interface CustomFieldsCreateResponse {
|
|
56
|
-
customFields:
|
|
66
|
+
customFields: CreatedCustomField[];
|
|
57
67
|
}
|
|
58
68
|
declare const CustomFieldsCreateResponseSchema: z.ZodType<CustomFieldsCreateResponse>;
|
|
59
69
|
//#endregion
|
|
60
|
-
export { AddressValue, AddressValueSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema };
|
|
70
|
+
export { AddressValue, AddressValueSchema, CreatedCustomField, CreatedCustomFieldSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema };
|
|
61
71
|
//# sourceMappingURL=schema.d.mts.map
|
|
@@ -12,7 +12,7 @@ const CustomFieldTypeSchema = z.enum([
|
|
|
12
12
|
"multiSelect"
|
|
13
13
|
]);
|
|
14
14
|
const CustomFieldEntityTypeSchema = z.enum(["client", "company"]);
|
|
15
|
-
const
|
|
15
|
+
const customFieldShape = {
|
|
16
16
|
entityType: CustomFieldEntityTypeSchema,
|
|
17
17
|
id: z.string(),
|
|
18
18
|
key: z.string(),
|
|
@@ -21,6 +21,11 @@ const CustomFieldSchema = z.object({
|
|
|
21
21
|
options: z.array(CustomFieldOptionSchema).optional(),
|
|
22
22
|
order: z.number(),
|
|
23
23
|
type: CustomFieldTypeSchema
|
|
24
|
+
};
|
|
25
|
+
const CustomFieldSchema = z.object(customFieldShape);
|
|
26
|
+
const CreatedCustomFieldSchema = z.object({
|
|
27
|
+
...customFieldShape,
|
|
28
|
+
object: z.literal("customField").optional()
|
|
24
29
|
});
|
|
25
30
|
const AddressValueSchema = z.object({
|
|
26
31
|
addressLine1: z.string().optional(),
|
|
@@ -45,8 +50,8 @@ const CustomFieldCreateInputSchema = z.object({
|
|
|
45
50
|
type: CustomFieldTypeSchema
|
|
46
51
|
});
|
|
47
52
|
const CustomFieldsCreateRequestSchema = z.object({ customFields: z.array(CustomFieldCreateInputSchema) });
|
|
48
|
-
const CustomFieldsCreateResponseSchema = z.object({ customFields: z.array(
|
|
53
|
+
const CustomFieldsCreateResponseSchema = z.object({ customFields: z.array(CreatedCustomFieldSchema).transform((v) => v || []) });
|
|
49
54
|
//#endregion
|
|
50
|
-
export { AddressValueSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, ListCustomFieldResponseSchema };
|
|
55
|
+
export { AddressValueSchema, CreatedCustomFieldSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, ListCustomFieldResponseSchema };
|
|
51
56
|
|
|
52
57
|
//# sourceMappingURL=schema.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/lib/modules/custom-fields/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { CustomFieldOption } from \"../custom-field-options\";\nimport { CustomFieldOptionSchema } from \"../custom-field-options\";\n\n// ─── Base ─────────────────────────────────────────────────────────────────────\n\nexport type CustomFieldType =\n | \"address\"\n | \"email\"\n | \"multiSelect\"\n | \"number\"\n | \"phoneNumber\"\n | \"text\"\n | \"url\";\n\nexport const CustomFieldTypeSchema: z.ZodType<CustomFieldType> = z.enum([\n \"address\",\n \"email\",\n \"phoneNumber\",\n \"text\",\n \"number\",\n \"url\",\n \"multiSelect\",\n]);\n\nexport type CustomFieldEntityType = \"client\" | \"company\";\n\nexport const CustomFieldEntityTypeSchema: z.ZodType<CustomFieldEntityType> = z.enum([\n \"client\",\n \"company\",\n]);\n\nexport interface CustomField {\n entityType: CustomFieldEntityType;\n id: string;\n key: string;\n name: string;\n object: \"customField\";\n options?: CustomFieldOption[];\n order: number;\n type: CustomFieldType;\n}\n\
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/lib/modules/custom-fields/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { CustomFieldOption } from \"../custom-field-options\";\nimport { CustomFieldOptionSchema } from \"../custom-field-options\";\n\n// ─── Base ─────────────────────────────────────────────────────────────────────\n\nexport type CustomFieldType =\n | \"address\"\n | \"email\"\n | \"multiSelect\"\n | \"number\"\n | \"phoneNumber\"\n | \"text\"\n | \"url\";\n\nexport const CustomFieldTypeSchema: z.ZodType<CustomFieldType> = z.enum([\n \"address\",\n \"email\",\n \"phoneNumber\",\n \"text\",\n \"number\",\n \"url\",\n \"multiSelect\",\n]);\n\nexport type CustomFieldEntityType = \"client\" | \"company\";\n\nexport const CustomFieldEntityTypeSchema: z.ZodType<CustomFieldEntityType> = z.enum([\n \"client\",\n \"company\",\n]);\n\nexport interface CustomField {\n entityType: CustomFieldEntityType;\n id: string;\n key: string;\n name: string;\n object: \"customField\";\n options?: CustomFieldOption[];\n order: number;\n type: CustomFieldType;\n}\n\nconst customFieldShape = {\n entityType: CustomFieldEntityTypeSchema,\n id: z.string(),\n key: z.string(),\n name: z.string(),\n object: z.literal(\"customField\"),\n options: z.array(CustomFieldOptionSchema).optional(),\n order: z.number(),\n type: CustomFieldTypeSchema,\n};\n\nexport const CustomFieldSchema: z.ZodType<CustomField> = z.object(customFieldShape);\n\n/**\n * `POST /v1/custom-fields` omits `object` from the fields it echoes back, though `GET` includes it\n * and the API reference documents it on both. Requiring it made a successful create throw\n * `AssemblyResponseParseError` after the field had been created — and a custom field cannot be\n * deleted through the API, so a retry left a duplicate behind. Drop this once the API sends it.\n */\nexport interface CreatedCustomField extends Omit<CustomField, \"object\"> {\n object?: \"customField\";\n}\n\nexport const CreatedCustomFieldSchema: z.ZodType<CreatedCustomField> = z.object({\n ...customFieldShape,\n object: z.literal(\"customField\").optional(),\n});\n\n// ─── Custom field value types ─────────────────────────────────────────────────\n\nexport interface AddressValue {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n country: string;\n fullAddress: string;\n postalCode?: string;\n region?: string;\n}\n\nexport const AddressValueSchema: z.ZodType<AddressValue> = z.object({\n addressLine1: z.string().optional(),\n addressLine2: z.string().optional(),\n city: z.string().optional(),\n country: z.string(),\n fullAddress: z.string(),\n postalCode: z.string().optional(),\n region: z.string().optional(),\n});\n\n/**\n * Union of all possible custom field values.\n * Order matters: number and string[] are tried before string to avoid\n * early matching on a less-specific branch.\n */\nexport type CustomFieldValue = AddressValue | number | string | string[];\n\nexport const CustomFieldValueSchema: z.ZodType<CustomFieldValue> = z.union([\n z.number(),\n z.array(z.string()),\n AddressValueSchema,\n z.string(),\n]);\n\n// ─── Response ─────────────────────────────────────────────────────────────────\n\nexport interface ListCustomFieldResponse {\n data: CustomField[];\n}\n\nexport const ListCustomFieldResponseSchema: z.ZodType<ListCustomFieldResponse> = z.object({\n data: z.array(CustomFieldSchema).transform((v) => v || []),\n});\n\n// ─── Requests ─────────────────────────────────────────────────────────────────\n\nexport interface CustomFieldCreateInput {\n entityType: CustomFieldEntityType;\n name: string;\n /** Only valid for `multiSelect` fields. */\n options?: { label: string }[];\n type: CustomFieldType;\n}\n\nexport const CustomFieldCreateInputSchema: z.ZodType<CustomFieldCreateInput> = z.object({\n entityType: CustomFieldEntityTypeSchema,\n name: z.string(),\n options: z.array(z.object({ label: z.string() })).optional(),\n type: CustomFieldTypeSchema,\n});\n\nexport interface CustomFieldsCreateRequest {\n customFields: CustomFieldCreateInput[];\n}\n\nexport const CustomFieldsCreateRequestSchema: z.ZodType<CustomFieldsCreateRequest> = z.object({\n customFields: z.array(CustomFieldCreateInputSchema),\n});\n\nexport interface CustomFieldsCreateResponse {\n customFields: CreatedCustomField[];\n}\n\nexport const CustomFieldsCreateResponseSchema: z.ZodType<CustomFieldsCreateResponse> = z.object({\n customFields: z.array(CreatedCustomFieldSchema).transform((v) => v || []),\n});\n"],"mappings":";;;;AAgBA,MAAa,wBAAoD,EAAE,KAAK;CACtE;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAIF,MAAa,8BAAgE,EAAE,KAAK,CAClF,UACA,UACD,CAAC;AAaF,MAAM,mBAAmB;CACvB,YAAY;CACZ,IAAI,EAAE,QAAQ;CACd,KAAK,EAAE,QAAQ;CACf,MAAM,EAAE,QAAQ;CAChB,QAAQ,EAAE,QAAQ,cAAc;CAChC,SAAS,EAAE,MAAM,wBAAwB,CAAC,UAAU;CACpD,OAAO,EAAE,QAAQ;CACjB,MAAM;CACP;AAED,MAAa,oBAA4C,EAAE,OAAO,iBAAiB;AAYnF,MAAa,2BAA0D,EAAE,OAAO;CAC9E,GAAG;CACH,QAAQ,EAAE,QAAQ,cAAc,CAAC,UAAU;CAC5C,CAAC;AAcF,MAAa,qBAA8C,EAAE,OAAO;CAClE,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,SAAS,EAAE,QAAQ;CACnB,aAAa,EAAE,QAAQ;CACvB,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC9B,CAAC;AASF,MAAa,yBAAsD,EAAE,MAAM;CACzE,EAAE,QAAQ;CACV,EAAE,MAAM,EAAE,QAAQ,CAAC;CACnB;CACA,EAAE,QAAQ;CACX,CAAC;AAQF,MAAa,gCAAoE,EAAE,OAAO,EACxF,MAAM,EAAE,MAAM,kBAAkB,CAAC,WAAW,MAAM,KAAK,EAAE,CAAC,EAC3D,CAAC;AAYF,MAAa,+BAAkE,EAAE,OAAO;CACtF,YAAY;CACZ,MAAM,EAAE,QAAQ;CAChB,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU;CAC5D,MAAM;CACP,CAAC;AAMF,MAAa,kCAAwE,EAAE,OAAO,EAC5F,cAAc,EAAE,MAAM,6BAA6B,EACpD,CAAC;AAMF,MAAa,mCAA0E,EAAE,OAAO,EAC9F,cAAc,EAAE,MAAM,yBAAyB,CAAC,WAAW,MAAM,KAAK,EAAE,CAAC,EAC1E,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientEr
|
|
|
5
5
|
import { ContractTemplate, ContractTemplateResponse, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponse, ContractTemplatesResponseSchema } from "./contract-templates/schema.mjs";
|
|
6
6
|
import { Contract, ContractField, ContractFieldInputType, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponse, ContractResponseSchema, ContractSchema, ContractSendRequest, ContractSendRequestSchema, ContractStatus, ContractStatusSchema, ContractsResponse, ContractsResponseSchema } from "./contracts/schema.mjs";
|
|
7
7
|
import { CustomFieldOption, CustomFieldOptionSchema, ListCustomFieldOptionResponse, ListCustomFieldOptionResponseSchema } from "./custom-field-options/schema.mjs";
|
|
8
|
-
import { AddressValue, AddressValueSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "./custom-fields/schema.mjs";
|
|
8
|
+
import { AddressValue, AddressValueSchema, CreatedCustomField, CreatedCustomFieldSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "./custom-fields/schema.mjs";
|
|
9
9
|
import { AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, ClientUserEventCreateRequest, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, InternalUserEventCreateRequest } from "./events/schema.mjs";
|
|
10
10
|
import { FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema } from "./file-channels/schema.mjs";
|
|
11
11
|
import { AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, ClientPermissions, ClientPermissionsSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema } from "./files/schema.mjs";
|
|
@@ -27,5 +27,5 @@ import { SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplat
|
|
|
27
27
|
import { Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponse, SubscriptionsResponseSchema } from "./subscriptions/schema.mjs";
|
|
28
28
|
import { TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema } from "./task-comments/schema.mjs";
|
|
29
29
|
import { TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema } from "./task-templates/schema.mjs";
|
|
30
|
-
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema } from "./tasks/schema.mjs";
|
|
30
|
+
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskEmail, TaskEmailSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TaskViewer, TaskViewerSchema, TasksResponse, TasksResponseSchema } from "./tasks/schema.mjs";
|
|
31
31
|
import { Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema } from "./workspace/schema.mjs";
|
|
@@ -3,18 +3,28 @@ import { z } from "zod";
|
|
|
3
3
|
//#region src/lib/modules/tasks/schema.d.ts
|
|
4
4
|
type TaskStatus = "completed" | "inProgress" | "todo";
|
|
5
5
|
declare const TaskStatusSchema: z.ZodType<TaskStatus>;
|
|
6
|
+
interface TaskViewer {
|
|
7
|
+
clientId?: string;
|
|
8
|
+
companyId?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const TaskViewerSchema: z.ZodType<TaskViewer>;
|
|
6
11
|
interface Task {
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
clientId?: string | null;
|
|
13
|
+
companyId?: string | null;
|
|
9
14
|
createdAt: string;
|
|
10
15
|
createdBy?: string;
|
|
11
16
|
description?: string;
|
|
12
17
|
dueDate?: string | null;
|
|
13
18
|
id: string;
|
|
19
|
+
internalUserId?: string | null;
|
|
20
|
+
isArchived?: boolean;
|
|
21
|
+
name?: string;
|
|
14
22
|
object: "task";
|
|
23
|
+
parentTaskId?: string | null;
|
|
15
24
|
status?: TaskStatus;
|
|
16
|
-
|
|
25
|
+
templateId?: string | null;
|
|
17
26
|
updatedAt?: string;
|
|
27
|
+
viewers?: TaskViewer[];
|
|
18
28
|
}
|
|
19
29
|
declare const TaskSchema: z.ZodType<Task>;
|
|
20
30
|
declare const TaskResponseSchema: z.ZodType<Task>;
|
|
@@ -24,22 +34,35 @@ interface TasksResponse {
|
|
|
24
34
|
nextToken?: string;
|
|
25
35
|
}
|
|
26
36
|
declare const TasksResponseSchema: z.ZodType<TasksResponse>;
|
|
27
|
-
interface
|
|
28
|
-
|
|
37
|
+
interface TaskFields {
|
|
38
|
+
clientId?: string;
|
|
39
|
+
companyId?: string;
|
|
29
40
|
description?: string;
|
|
30
41
|
dueDate?: string;
|
|
42
|
+
internalUserId?: string;
|
|
43
|
+
isArchived?: boolean;
|
|
44
|
+
name?: string;
|
|
45
|
+
parentTaskId?: string;
|
|
31
46
|
status?: TaskStatus;
|
|
47
|
+
templateId?: string;
|
|
48
|
+
viewers?: TaskViewer[];
|
|
49
|
+
}
|
|
50
|
+
/** Overrides the assignment email sent to the assignee. `htmlBody` allows only p, br, strong/b, em/i, ul, ol, li and https links. */
|
|
51
|
+
interface TaskEmail {
|
|
52
|
+
body?: string;
|
|
53
|
+
ctaParams?: Record<string, string>;
|
|
54
|
+
header: string;
|
|
55
|
+
htmlBody?: string;
|
|
56
|
+
subject: string;
|
|
32
57
|
title: string;
|
|
33
58
|
}
|
|
34
|
-
declare const
|
|
35
|
-
interface
|
|
36
|
-
|
|
37
|
-
description?: string;
|
|
38
|
-
dueDate?: string;
|
|
39
|
-
status?: TaskStatus;
|
|
40
|
-
title?: string;
|
|
59
|
+
declare const TaskEmailSchema: z.ZodType<TaskEmail>;
|
|
60
|
+
interface TaskCreateRequest extends TaskFields {
|
|
61
|
+
email?: TaskEmail;
|
|
41
62
|
}
|
|
63
|
+
declare const TaskCreateRequestSchema: z.ZodType<TaskCreateRequest>;
|
|
64
|
+
type TaskUpdateRequest = TaskFields;
|
|
42
65
|
declare const TaskUpdateRequestSchema: z.ZodType<TaskUpdateRequest>;
|
|
43
66
|
//#endregion
|
|
44
|
-
export { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema };
|
|
67
|
+
export { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskEmail, TaskEmailSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TaskViewer, TaskViewerSchema, TasksResponse, TasksResponseSchema };
|
|
45
68
|
//# sourceMappingURL=schema.d.mts.map
|
|
@@ -5,39 +5,60 @@ const TaskStatusSchema = z.enum([
|
|
|
5
5
|
"inProgress",
|
|
6
6
|
"completed"
|
|
7
7
|
]);
|
|
8
|
+
const TaskViewerSchema = z.object({
|
|
9
|
+
clientId: z.string().optional(),
|
|
10
|
+
companyId: z.string().optional()
|
|
11
|
+
});
|
|
8
12
|
const TaskSchema = z.object({
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
clientId: z.string().nullable().optional(),
|
|
14
|
+
companyId: z.string().nullable().optional(),
|
|
11
15
|
createdAt: z.iso.datetime(),
|
|
12
16
|
createdBy: z.string().optional(),
|
|
13
17
|
description: z.string().optional(),
|
|
14
18
|
dueDate: z.string().nullable().optional(),
|
|
15
19
|
id: z.string(),
|
|
20
|
+
internalUserId: z.string().nullable().optional(),
|
|
21
|
+
isArchived: z.boolean().optional(),
|
|
22
|
+
name: z.string().optional(),
|
|
16
23
|
object: z.literal("task"),
|
|
24
|
+
parentTaskId: z.string().nullable().optional(),
|
|
17
25
|
status: TaskStatusSchema.optional(),
|
|
18
|
-
|
|
19
|
-
updatedAt: z.iso.datetime().optional()
|
|
26
|
+
templateId: z.string().nullable().optional(),
|
|
27
|
+
updatedAt: z.iso.datetime().optional(),
|
|
28
|
+
viewers: z.array(TaskViewerSchema).optional()
|
|
20
29
|
});
|
|
21
30
|
const TaskResponseSchema = TaskSchema;
|
|
22
31
|
const TasksResponseSchema = z.object({
|
|
23
32
|
data: z.array(TaskSchema).nullable(),
|
|
24
33
|
nextToken: z.string().optional()
|
|
25
34
|
});
|
|
26
|
-
const
|
|
27
|
-
|
|
35
|
+
const taskFieldsShape = {
|
|
36
|
+
clientId: z.string().optional(),
|
|
37
|
+
companyId: z.string().optional(),
|
|
28
38
|
description: z.string().optional(),
|
|
29
39
|
dueDate: z.string().optional(),
|
|
40
|
+
internalUserId: z.string().optional(),
|
|
41
|
+
isArchived: z.boolean().optional(),
|
|
42
|
+
name: z.string().optional(),
|
|
43
|
+
parentTaskId: z.string().optional(),
|
|
30
44
|
status: TaskStatusSchema.optional(),
|
|
45
|
+
templateId: z.string().optional(),
|
|
46
|
+
viewers: z.array(TaskViewerSchema).optional()
|
|
47
|
+
};
|
|
48
|
+
const TaskEmailSchema = z.object({
|
|
49
|
+
body: z.string().optional(),
|
|
50
|
+
ctaParams: z.record(z.string(), z.string()).optional(),
|
|
51
|
+
header: z.string(),
|
|
52
|
+
htmlBody: z.string().optional(),
|
|
53
|
+
subject: z.string(),
|
|
31
54
|
title: z.string()
|
|
32
55
|
});
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
dueDate: z.string().optional(),
|
|
37
|
-
status: TaskStatusSchema.optional(),
|
|
38
|
-
title: z.string().optional()
|
|
56
|
+
const TaskCreateRequestSchema = z.object({
|
|
57
|
+
...taskFieldsShape,
|
|
58
|
+
email: TaskEmailSchema.optional()
|
|
39
59
|
});
|
|
60
|
+
const TaskUpdateRequestSchema = z.object(taskFieldsShape);
|
|
40
61
|
//#endregion
|
|
41
|
-
export { TaskCreateRequestSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskUpdateRequestSchema, TasksResponseSchema };
|
|
62
|
+
export { TaskCreateRequestSchema, TaskEmailSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskUpdateRequestSchema, TaskViewerSchema, TasksResponseSchema };
|
|
42
63
|
|
|
43
64
|
//# sourceMappingURL=schema.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/lib/modules/tasks/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Base types\n// ---------------------------------------------------------------------------\n\nexport type TaskStatus = \"completed\" | \"inProgress\" | \"todo\";\n\nexport const TaskStatusSchema: z.ZodType<TaskStatus> = z.enum([\"todo\", \"inProgress\", \"completed\"]);\n\nexport interface Task {\n
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/lib/modules/tasks/schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Base types\n// ---------------------------------------------------------------------------\n\nexport type TaskStatus = \"completed\" | \"inProgress\" | \"todo\";\n\nexport const TaskStatusSchema: z.ZodType<TaskStatus> = z.enum([\"todo\", \"inProgress\", \"completed\"]);\n\nexport interface TaskViewer {\n clientId?: string;\n companyId?: string;\n}\n\nexport const TaskViewerSchema: z.ZodType<TaskViewer> = z.object({\n clientId: z.string().optional(),\n companyId: z.string().optional(),\n});\n\nexport interface Task {\n clientId?: string | null;\n companyId?: string | null;\n createdAt: string;\n createdBy?: string;\n description?: string;\n dueDate?: string | null;\n id: string;\n internalUserId?: string | null;\n isArchived?: boolean;\n name?: string;\n object: \"task\";\n parentTaskId?: string | null;\n status?: TaskStatus;\n templateId?: string | null;\n updatedAt?: string;\n viewers?: TaskViewer[];\n}\n\nexport const TaskSchema: z.ZodType<Task> = z.object({\n clientId: z.string().nullable().optional(),\n companyId: z.string().nullable().optional(),\n createdAt: z.iso.datetime(),\n createdBy: z.string().optional(),\n description: z.string().optional(),\n dueDate: z.string().nullable().optional(),\n id: z.string(),\n internalUserId: z.string().nullable().optional(),\n isArchived: z.boolean().optional(),\n name: z.string().optional(),\n object: z.literal(\"task\"),\n parentTaskId: z.string().nullable().optional(),\n status: TaskStatusSchema.optional(),\n templateId: z.string().nullable().optional(),\n updatedAt: z.iso.datetime().optional(),\n viewers: z.array(TaskViewerSchema).optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Response types\n// ---------------------------------------------------------------------------\n\nexport const TaskResponseSchema: z.ZodType<Task> = TaskSchema;\nexport type TaskResponse = Task;\n\nexport interface TasksResponse {\n data: Task[] | null;\n nextToken?: string;\n}\n\nexport const TasksResponseSchema: z.ZodType<TasksResponse> = z.object({\n data: z.array(TaskSchema).nullable(),\n nextToken: z.string().optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Request types\n// ---------------------------------------------------------------------------\n\ninterface TaskFields {\n clientId?: string;\n companyId?: string;\n description?: string;\n dueDate?: string;\n internalUserId?: string;\n isArchived?: boolean;\n name?: string;\n parentTaskId?: string;\n status?: TaskStatus;\n templateId?: string;\n viewers?: TaskViewer[];\n}\n\nconst taskFieldsShape = {\n clientId: z.string().optional(),\n companyId: z.string().optional(),\n description: z.string().optional(),\n dueDate: z.string().optional(),\n internalUserId: z.string().optional(),\n isArchived: z.boolean().optional(),\n name: z.string().optional(),\n parentTaskId: z.string().optional(),\n status: TaskStatusSchema.optional(),\n templateId: z.string().optional(),\n viewers: z.array(TaskViewerSchema).optional(),\n};\n\n/** Overrides the assignment email sent to the assignee. `htmlBody` allows only p, br, strong/b, em/i, ul, ol, li and https links. */\nexport interface TaskEmail {\n body?: string;\n ctaParams?: Record<string, string>;\n header: string;\n htmlBody?: string;\n subject: string;\n title: string;\n}\n\nexport const TaskEmailSchema: z.ZodType<TaskEmail> = z.object({\n body: z.string().optional(),\n ctaParams: z.record(z.string(), z.string()).optional(),\n header: z.string(),\n htmlBody: z.string().optional(),\n subject: z.string(),\n title: z.string(),\n});\n\nexport interface TaskCreateRequest extends TaskFields {\n email?: TaskEmail;\n}\n\nexport const TaskCreateRequestSchema: z.ZodType<TaskCreateRequest> = z.object({\n ...taskFieldsShape,\n email: TaskEmailSchema.optional(),\n});\n\nexport type TaskUpdateRequest = TaskFields;\n\nexport const TaskUpdateRequestSchema: z.ZodType<TaskUpdateRequest> = z.object(taskFieldsShape);\n"],"mappings":";;AAQA,MAAa,mBAA0C,EAAE,KAAK;CAAC;CAAQ;CAAc;CAAY,CAAC;AAOlG,MAAa,mBAA0C,EAAE,OAAO;CAC9D,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,WAAW,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC;AAqBF,MAAa,aAA8B,EAAE,OAAO;CAClD,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC1C,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC3C,WAAW,EAAE,IAAI,UAAU;CAC3B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CACzC,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAChD,YAAY,EAAE,SAAS,CAAC,UAAU;CAClC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,QAAQ,EAAE,QAAQ,OAAO;CACzB,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC9C,QAAQ,iBAAiB,UAAU;CACnC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC5C,WAAW,EAAE,IAAI,UAAU,CAAC,UAAU;CACtC,SAAS,EAAE,MAAM,iBAAiB,CAAC,UAAU;CAC9C,CAAC;AAMF,MAAa,qBAAsC;AAQnD,MAAa,sBAAgD,EAAE,OAAO;CACpE,MAAM,EAAE,MAAM,WAAW,CAAC,UAAU;CACpC,WAAW,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC;AAoBF,MAAM,kBAAkB;CACtB,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,YAAY,EAAE,SAAS,CAAC,UAAU;CAClC,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,QAAQ,iBAAiB,UAAU;CACnC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,SAAS,EAAE,MAAM,iBAAiB,CAAC,UAAU;CAC9C;AAYD,MAAa,kBAAwC,EAAE,OAAO;CAC5D,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,UAAU;CACtD,QAAQ,EAAE,QAAQ;CAClB,UAAU,EAAE,QAAQ,CAAC,UAAU;CAC/B,SAAS,EAAE,QAAQ;CACnB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAMF,MAAa,0BAAwD,EAAE,OAAO;CAC5E,GAAG;CACH,OAAO,gBAAgB,UAAU;CAClC,CAAC;AAIF,MAAa,0BAAwD,EAAE,OAAO,gBAAgB"}
|
package/dist/schemas/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ import { CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientEr
|
|
|
7
7
|
import { ContractTemplate, ContractTemplateResponse, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponse, ContractTemplatesResponseSchema } from "../lib/modules/contract-templates/schema.mjs";
|
|
8
8
|
import { Contract, ContractField, ContractFieldInputType, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponse, ContractResponseSchema, ContractSchema, ContractSendRequest, ContractSendRequestSchema, ContractStatus, ContractStatusSchema, ContractsResponse, ContractsResponseSchema } from "../lib/modules/contracts/schema.mjs";
|
|
9
9
|
import { CustomFieldOption, CustomFieldOptionSchema, ListCustomFieldOptionResponse, ListCustomFieldOptionResponseSchema } from "../lib/modules/custom-field-options/schema.mjs";
|
|
10
|
-
import { AddressValue, AddressValueSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "../lib/modules/custom-fields/schema.mjs";
|
|
10
|
+
import { AddressValue, AddressValueSchema, CreatedCustomField, CreatedCustomFieldSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, ListCustomFieldResponse, ListCustomFieldResponseSchema } from "../lib/modules/custom-fields/schema.mjs";
|
|
11
11
|
import { AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, ClientUserEventCreateRequest, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, InternalUserEventCreateRequest } from "../lib/modules/events/schema.mjs";
|
|
12
12
|
import { FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema } from "../lib/modules/file-channels/schema.mjs";
|
|
13
13
|
import { AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, ClientPermissions, ClientPermissionsSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema } from "../lib/modules/files/schema.mjs";
|
|
@@ -29,7 +29,7 @@ import { SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplat
|
|
|
29
29
|
import { Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponse, SubscriptionsResponseSchema } from "../lib/modules/subscriptions/schema.mjs";
|
|
30
30
|
import { TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema } from "../lib/modules/task-comments/schema.mjs";
|
|
31
31
|
import { TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema } from "../lib/modules/task-templates/schema.mjs";
|
|
32
|
-
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema } from "../lib/modules/tasks/schema.mjs";
|
|
32
|
+
import { Task, TaskCreateRequest, TaskCreateRequestSchema, TaskEmail, TaskEmailSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TaskViewer, TaskViewerSchema, TasksResponse, TasksResponseSchema } from "../lib/modules/tasks/schema.mjs";
|
|
33
33
|
import { Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema } from "../lib/modules/workspace/schema.mjs";
|
|
34
34
|
import { TokenPayload, TokenPayloadSchema } from "./shared/token.mjs";
|
|
35
|
-
export { AddressValue, AddressValueSchema, AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema, AppInstall, AppInstallResponse, AppInstallResponseSchema, AppInstallSchema, AppInstallType, AppInstallTypeSchema, AppInstallsResponse, AppInstallsResponseSchema, AppNotificationActionLabel, AppNotificationActionLabelSchema, AppNotificationSetting, AppNotificationSettingSchema, AppNotificationSettingsCreateRequest, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponse, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequest, AppNotificationSettingsUpdateRequestSchema, AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, BillingPeriod, BillingPeriodSchema, Client, ClientCreateRequest, ClientCreateRequestSchema, ClientPermissions, ClientPermissionsSchema, ClientResponse, ClientResponseSchema, ClientSchema, ClientUpdateRequest, ClientUpdateRequestSchema, ClientUserEventCreateRequest, ClientWithAppVisibility, ClientWithAppVisibilitySchema, ClientsResponse, ClientsResponseSchema, CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientError, CompanyAddClientsRequest, CompanyAddClientsRequestSchema, CompanyAddClientsResponse, CompanyAddClientsResponseSchema, 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, CurrentUser, CurrentUserResponse, CurrentUserResponseSchema, CurrentUserSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldOption, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, EmailDeliveryTarget, EmailDeliveryTargetSchema, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema, Form, FormAdditionalFields, FormAdditionalFieldsSchema, FormCreateRequest, FormCreateRequestSchema, FormDataResponse, FormDataResponseSchema, FormField, FormFieldSchema, FormFieldType, FormFieldTypeSchema, FormFields, FormFieldsSchema, FormResponse, FormResponseCreateRequest, FormResponseCreateRequestSchema, FormResponseItemResponse, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponse, FormResponsesResponseSchema, FormSchema, FormVisibility, FormVisibilitySchema, FormsDataResponse, FormsDataResponseSchema, HexColor, HexColorSchema, InProductDeliveryTarget, InProductDeliveryTargetSchema, InternalUser, InternalUserEmailSetting, InternalUserEmailSettingSchema, InternalUserEventCreateRequest, InternalUserNotificationSettings, InternalUserNotificationSettingsSchema, InternalUserResponse, InternalUserResponseSchema, InternalUserSchema, InternalUserUpdateRequest, InternalUserUpdateRequestSchema, InternalUsersResponse, InternalUsersResponseSchema, Invoice, InvoiceCreateRequest, InvoiceCreateRequestSchema, InvoiceLineItem, InvoiceLineItemRequest, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequest, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponse, InvoiceResponseSchema, InvoiceSchema, InvoiceStatus, InvoiceStatusSchema, InvoiceTemplate, InvoiceTemplateResponse, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponse, InvoiceTemplatesResponseSchema, InvoicesResponse, InvoicesResponseSchema, 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, NotificationCategorySetting, NotificationCategorySettingSchema, NotificationCreateRequest, NotificationCreateRequestSchema, NotificationDeliveryTargets, NotificationDeliveryTargetsSchema, NotificationResponse, NotificationResponseSchema, NotificationSchema, NotificationSurface, NotificationSurfaceSchema, NotificationsResponse, NotificationsResponseSchema, Payment, PaymentMethodPreference, PaymentMethodPreferenceSchema, PaymentMethodType, PaymentMethodTypeSchema, PaymentResponse, PaymentResponseSchema, PaymentSchema, PaymentsResponse, PaymentsResponseSchema, Price, PriceCreateRequest, PriceCreateRequestSchema, PriceResponse, PriceResponseSchema, PriceSchema, PriceType, PriceTypeSchema, PricesResponse, PricesResponseSchema, Product, ProductCreateRequest, ProductCreateRequestSchema, ProductResponse, ProductResponseSchema, ProductSchema, ProductsResponse, ProductsResponseSchema, Refund, RefundCreateRequest, RefundCreateRequestSchema, RefundResponse, RefundResponseSchema, RefundSchema, RefundStatus, RefundStatusSchema, RefundsResponse, RefundsResponseSchema, SendMessageRequest, SendMessageRequestSchema, Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponse, SubscriptionTemplatesResponseSchema, SubscriptionsResponse, SubscriptionsResponseSchema, Task, TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema, TaskCreateRequest, TaskCreateRequestSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TasksResponse, TasksResponseSchema, TokenPayload, TokenPayloadSchema, UnreadMessageChannelsResponse, UnreadMessageChannelsResponseSchema, Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema };
|
|
35
|
+
export { AddressValue, AddressValueSchema, AppConnection, AppConnectionCreateRequest, AppConnectionCreateRequestSchema, AppConnectionResponse, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionType, AppConnectionTypeSchema, AppConnectionsResponse, AppConnectionsResponseSchema, AppInstall, AppInstallResponse, AppInstallResponseSchema, AppInstallSchema, AppInstallType, AppInstallTypeSchema, AppInstallsResponse, AppInstallsResponseSchema, AppNotificationActionLabel, AppNotificationActionLabelSchema, AppNotificationSetting, AppNotificationSettingSchema, AppNotificationSettingsCreateRequest, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponse, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequest, AppNotificationSettingsUpdateRequestSchema, AssemblyFile, AssemblyFileResponse, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponse, AssemblyFilesResponseSchema, AuditLogEvent, AuditLogEventResponse, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponse, AuditLogEventsResponseSchema, BillingPeriod, BillingPeriodSchema, Client, ClientCreateRequest, ClientCreateRequestSchema, ClientPermissions, ClientPermissionsSchema, ClientResponse, ClientResponseSchema, ClientSchema, ClientUpdateRequest, ClientUpdateRequestSchema, ClientUserEventCreateRequest, ClientWithAppVisibility, ClientWithAppVisibilitySchema, ClientsResponse, ClientsResponseSchema, CompaniesResponse, CompaniesResponseSchema, Company, CompanyAddClientError, CompanyAddClientsRequest, CompanyAddClientsRequestSchema, CompanyAddClientsResponse, CompanyAddClientsResponseSchema, 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, CreatedCustomField, CreatedCustomFieldSchema, CurrentUser, CurrentUserResponse, CurrentUserResponseSchema, CurrentUserSchema, CustomField, CustomFieldCreateInput, CustomFieldCreateInputSchema, CustomFieldEntityType, CustomFieldEntityTypeSchema, CustomFieldOption, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldType, CustomFieldTypeSchema, CustomFieldValue, CustomFieldValueSchema, CustomFieldsCreateRequest, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponse, CustomFieldsCreateResponseSchema, EmailDeliveryTarget, EmailDeliveryTargetSchema, EventActorType, EventActorTypeSchema, EventCreateRequest, EventCreateRequestSchema, EventSource, EventSourceSchema, FileChannel, FileChannelCreateRequest, FileChannelCreateRequestSchema, FileChannelResponse, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponse, FileChannelsResponseSchema, FileDownloadUrlResponse, FileDownloadUrlResponseSchema, FilePermissionsResponse, FilePermissionsResponseSchema, FileType, FileTypeSchema, Form, FormAdditionalFields, FormAdditionalFieldsSchema, FormCreateRequest, FormCreateRequestSchema, FormDataResponse, FormDataResponseSchema, FormField, FormFieldSchema, FormFieldType, FormFieldTypeSchema, FormFields, FormFieldsSchema, FormResponse, FormResponseCreateRequest, FormResponseCreateRequestSchema, FormResponseItemResponse, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponse, FormResponsesResponseSchema, FormSchema, FormVisibility, FormVisibilitySchema, FormsDataResponse, FormsDataResponseSchema, HexColor, HexColorSchema, InProductDeliveryTarget, InProductDeliveryTargetSchema, InternalUser, InternalUserEmailSetting, InternalUserEmailSettingSchema, InternalUserEventCreateRequest, InternalUserNotificationSettings, InternalUserNotificationSettingsSchema, InternalUserResponse, InternalUserResponseSchema, InternalUserSchema, InternalUserUpdateRequest, InternalUserUpdateRequestSchema, InternalUsersResponse, InternalUsersResponseSchema, Invoice, InvoiceCreateRequest, InvoiceCreateRequestSchema, InvoiceLineItem, InvoiceLineItemRequest, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequest, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponse, InvoiceResponseSchema, InvoiceSchema, InvoiceStatus, InvoiceStatusSchema, InvoiceTemplate, InvoiceTemplateResponse, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponse, InvoiceTemplatesResponseSchema, InvoicesResponse, InvoicesResponseSchema, 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, NotificationCategorySetting, NotificationCategorySettingSchema, NotificationCreateRequest, NotificationCreateRequestSchema, NotificationDeliveryTargets, NotificationDeliveryTargetsSchema, NotificationResponse, NotificationResponseSchema, NotificationSchema, NotificationSurface, NotificationSurfaceSchema, NotificationsResponse, NotificationsResponseSchema, Payment, PaymentMethodPreference, PaymentMethodPreferenceSchema, PaymentMethodType, PaymentMethodTypeSchema, PaymentResponse, PaymentResponseSchema, PaymentSchema, PaymentsResponse, PaymentsResponseSchema, Price, PriceCreateRequest, PriceCreateRequestSchema, PriceResponse, PriceResponseSchema, PriceSchema, PriceType, PriceTypeSchema, PricesResponse, PricesResponseSchema, Product, ProductCreateRequest, ProductCreateRequestSchema, ProductResponse, ProductResponseSchema, ProductSchema, ProductsResponse, ProductsResponseSchema, Refund, RefundCreateRequest, RefundCreateRequestSchema, RefundResponse, RefundResponseSchema, RefundSchema, RefundStatus, RefundStatusSchema, RefundsResponse, RefundsResponseSchema, SendMessageRequest, SendMessageRequestSchema, Subscription, SubscriptionCreateRequest, SubscriptionCreateRequestSchema, SubscriptionResponse, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplate, SubscriptionTemplateResponse, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponse, SubscriptionTemplatesResponseSchema, SubscriptionsResponse, SubscriptionsResponseSchema, Task, TaskComment, TaskCommentResponse, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponse, TaskCommentsResponseSchema, TaskCreateRequest, TaskCreateRequestSchema, TaskEmail, TaskEmailSchema, TaskResponse, TaskResponseSchema, TaskSchema, TaskStatus, TaskStatusSchema, TaskTemplate, TaskTemplateResponse, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponse, TaskTemplatesResponseSchema, TaskUpdateRequest, TaskUpdateRequestSchema, TaskViewer, TaskViewerSchema, TasksResponse, TasksResponseSchema, TokenPayload, TokenPayloadSchema, UnreadMessageChannelsResponse, UnreadMessageChannelsResponseSchema, Workspace, WorkspaceResponse, WorkspaceResponseSchema, WorkspaceSchema };
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { CompaniesResponseSchema, CompanyAddClientsRequestSchema, CompanyAddClie
|
|
|
7
7
|
import { ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema } from "../lib/modules/contract-templates/schema.mjs";
|
|
8
8
|
import { ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractsResponseSchema } from "../lib/modules/contracts/schema.mjs";
|
|
9
9
|
import { CustomFieldOptionSchema, ListCustomFieldOptionResponseSchema } from "../lib/modules/custom-field-options/schema.mjs";
|
|
10
|
-
import { AddressValueSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, ListCustomFieldResponseSchema } from "../lib/modules/custom-fields/schema.mjs";
|
|
10
|
+
import { AddressValueSchema, CreatedCustomFieldSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, ListCustomFieldResponseSchema } from "../lib/modules/custom-fields/schema.mjs";
|
|
11
11
|
import { AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema } from "../lib/modules/events/schema.mjs";
|
|
12
12
|
import { FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema } from "../lib/modules/file-channels/schema.mjs";
|
|
13
13
|
import { AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, ClientPermissionsSchema, FileDownloadUrlResponseSchema, FilePermissionsResponseSchema, FileTypeSchema } from "../lib/modules/files/schema.mjs";
|
|
@@ -29,9 +29,9 @@ import { SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, Subscri
|
|
|
29
29
|
import { SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionsResponseSchema } from "../lib/modules/subscriptions/schema.mjs";
|
|
30
30
|
import { TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponseSchema } from "../lib/modules/task-comments/schema.mjs";
|
|
31
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";
|
|
32
|
+
import { TaskCreateRequestSchema, TaskEmailSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskUpdateRequestSchema, TaskViewerSchema, TasksResponseSchema } from "../lib/modules/tasks/schema.mjs";
|
|
33
33
|
import { WorkspaceResponseSchema, WorkspaceSchema } from "../lib/modules/workspace/schema.mjs";
|
|
34
34
|
import { TokenPayloadSchema } from "./shared/token.mjs";
|
|
35
35
|
import "../lib/modules/index.mjs";
|
|
36
36
|
import "./shared/index.mjs";
|
|
37
|
-
export { AddressValueSchema, AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema, AppInstallResponseSchema, AppInstallSchema, AppInstallTypeSchema, AppInstallsResponseSchema, AppNotificationActionLabelSchema, AppNotificationSettingSchema, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequestSchema, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, BillingPeriodSchema, ClientCreateRequestSchema, ClientPermissionsSchema, ClientResponseSchema, ClientSchema, ClientUpdateRequestSchema, ClientWithAppVisibilitySchema, ClientsResponseSchema, CompaniesResponseSchema, CompanyAddClientsRequestSchema, CompanyAddClientsResponseSchema, CompanyCreateRequestSchema, CompanyResponseSchema, CompanySchema, CompanyUpdateRequestSchema, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema, ContractsResponseSchema, CurrentUserResponseSchema, CurrentUserSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, EmailDeliveryTargetSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema, FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema, FileDownloadUrlResponseSchema, FilePermissionsResponseSchema, FileTypeSchema, FormAdditionalFieldsSchema, FormCreateRequestSchema, FormDataResponseSchema, FormFieldSchema, FormFieldTypeSchema, FormFieldsSchema, FormResponseCreateRequestSchema, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponseSchema, FormSchema, FormVisibilitySchema, FormsDataResponseSchema, HexColorSchema, InProductDeliveryTargetSchema, InternalUserEmailSettingSchema, InternalUserNotificationSettingsSchema, InternalUserResponseSchema, InternalUserSchema, InternalUserUpdateRequestSchema, InternalUsersResponseSchema, InvoiceCreateRequestSchema, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponseSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponseSchema, InvoicesResponseSchema, ListCustomFieldOptionResponseSchema, ListCustomFieldResponseSchema, MembershipTypeSchema, MessageChannelCreateRequestSchema, MessageChannelResponseSchema, MessageChannelSchema, MessageChannelsResponseSchema, MessageResponseSchema, MessageSchema, MessagesResponseSchema, NoteCreateRequestSchema, NoteResponseSchema, NoteSchema, NoteUpdateRequestSchema, NotesResponseSchema, NotificationCategorySettingSchema, NotificationCreateRequestSchema, NotificationDeliveryTargetsSchema, NotificationResponseSchema, NotificationSchema, NotificationSurfaceSchema, NotificationsResponseSchema, PaymentMethodPreferenceSchema, PaymentMethodTypeSchema, PaymentResponseSchema, PaymentSchema, PaymentsResponseSchema, PriceCreateRequestSchema, PriceResponseSchema, PriceSchema, PriceTypeSchema, PricesResponseSchema, ProductCreateRequestSchema, ProductResponseSchema, ProductSchema, ProductsResponseSchema, RefundCreateRequestSchema, RefundResponseSchema, RefundSchema, RefundStatusSchema, RefundsResponseSchema, SendMessageRequestSchema, SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponseSchema, SubscriptionsResponseSchema, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponseSchema, TaskCreateRequestSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema, TaskUpdateRequestSchema, TasksResponseSchema, TokenPayloadSchema, UnreadMessageChannelsResponseSchema, WorkspaceResponseSchema, WorkspaceSchema };
|
|
37
|
+
export { AddressValueSchema, AppConnectionCreateRequestSchema, AppConnectionResponseSchema, AppConnectionSchema, AppConnectionTypeSchema, AppConnectionsResponseSchema, AppInstallResponseSchema, AppInstallSchema, AppInstallTypeSchema, AppInstallsResponseSchema, AppNotificationActionLabelSchema, AppNotificationSettingSchema, AppNotificationSettingsCreateRequestSchema, AppNotificationSettingsResponseSchema, AppNotificationSettingsUpdateRequestSchema, AssemblyFileResponseSchema, AssemblyFileSchema, AssemblyFilesResponseSchema, AuditLogEventResponseSchema, AuditLogEventSchema, AuditLogEventsResponseSchema, BillingPeriodSchema, ClientCreateRequestSchema, ClientPermissionsSchema, ClientResponseSchema, ClientSchema, ClientUpdateRequestSchema, ClientWithAppVisibilitySchema, ClientsResponseSchema, CompaniesResponseSchema, CompanyAddClientsRequestSchema, CompanyAddClientsResponseSchema, CompanyCreateRequestSchema, CompanyResponseSchema, CompanySchema, CompanyUpdateRequestSchema, ContractFieldInputTypeSchema, ContractFieldSchema, ContractResponseSchema, ContractSchema, ContractSendRequestSchema, ContractStatusSchema, ContractTemplateResponseSchema, ContractTemplateSchema, ContractTemplatesResponseSchema, ContractsResponseSchema, CreatedCustomFieldSchema, CurrentUserResponseSchema, CurrentUserSchema, CustomFieldCreateInputSchema, CustomFieldEntityTypeSchema, CustomFieldOptionSchema, CustomFieldSchema, CustomFieldTypeSchema, CustomFieldValueSchema, CustomFieldsCreateRequestSchema, CustomFieldsCreateResponseSchema, EmailDeliveryTargetSchema, EventActorTypeSchema, EventCreateRequestSchema, EventSourceSchema, FileChannelCreateRequestSchema, FileChannelResponseSchema, FileChannelSchema, FileChannelsResponseSchema, FileDownloadUrlResponseSchema, FilePermissionsResponseSchema, FileTypeSchema, FormAdditionalFieldsSchema, FormCreateRequestSchema, FormDataResponseSchema, FormFieldSchema, FormFieldTypeSchema, FormFieldsSchema, FormResponseCreateRequestSchema, FormResponseItemResponseSchema, FormResponseSchema, FormResponsesResponseSchema, FormSchema, FormVisibilitySchema, FormsDataResponseSchema, HexColorSchema, InProductDeliveryTargetSchema, InternalUserEmailSettingSchema, InternalUserNotificationSettingsSchema, InternalUserResponseSchema, InternalUserSchema, InternalUserUpdateRequestSchema, InternalUsersResponseSchema, InvoiceCreateRequestSchema, InvoiceLineItemRequestSchema, InvoiceLineItemSchema, InvoicePaymentMethodPreferenceRequestSchema, InvoiceResponseSchema, InvoiceSchema, InvoiceStatusSchema, InvoiceTemplateResponseSchema, InvoiceTemplateSchema, InvoiceTemplatesResponseSchema, InvoicesResponseSchema, ListCustomFieldOptionResponseSchema, ListCustomFieldResponseSchema, MembershipTypeSchema, MessageChannelCreateRequestSchema, MessageChannelResponseSchema, MessageChannelSchema, MessageChannelsResponseSchema, MessageResponseSchema, MessageSchema, MessagesResponseSchema, NoteCreateRequestSchema, NoteResponseSchema, NoteSchema, NoteUpdateRequestSchema, NotesResponseSchema, NotificationCategorySettingSchema, NotificationCreateRequestSchema, NotificationDeliveryTargetsSchema, NotificationResponseSchema, NotificationSchema, NotificationSurfaceSchema, NotificationsResponseSchema, PaymentMethodPreferenceSchema, PaymentMethodTypeSchema, PaymentResponseSchema, PaymentSchema, PaymentsResponseSchema, PriceCreateRequestSchema, PriceResponseSchema, PriceSchema, PriceTypeSchema, PricesResponseSchema, ProductCreateRequestSchema, ProductResponseSchema, ProductSchema, ProductsResponseSchema, RefundCreateRequestSchema, RefundResponseSchema, RefundSchema, RefundStatusSchema, RefundsResponseSchema, SendMessageRequestSchema, SubscriptionCreateRequestSchema, SubscriptionResponseSchema, SubscriptionSchema, SubscriptionTemplateResponseSchema, SubscriptionTemplateSchema, SubscriptionTemplatesResponseSchema, SubscriptionsResponseSchema, TaskCommentResponseSchema, TaskCommentSchema, TaskCommentsResponseSchema, TaskCreateRequestSchema, TaskEmailSchema, TaskResponseSchema, TaskSchema, TaskStatusSchema, TaskTemplateResponseSchema, TaskTemplateSchema, TaskTemplatesResponseSchema, TaskUpdateRequestSchema, TaskViewerSchema, TasksResponseSchema, TokenPayloadSchema, UnreadMessageChannelsResponseSchema, WorkspaceResponseSchema, WorkspaceSchema };
|
|
@@ -69,6 +69,12 @@ declare class AssemblyToken {
|
|
|
69
69
|
get isClientUser(): boolean;
|
|
70
70
|
/** `true` when the token belongs to an internal (team member) user. */
|
|
71
71
|
get isInternalUser(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* `true` when an internal user is proxying as a client (CRM "preview as client"):
|
|
74
|
+
* both `internalUserId` and `clientId` are present. Both `isClientUser` and
|
|
75
|
+
* `isInternalUser` are also `true` in this case — branch on this getter first.
|
|
76
|
+
*/
|
|
77
|
+
get isProxying(): boolean;
|
|
72
78
|
/**
|
|
73
79
|
* Assert that the token belongs to a client user and return the narrowed payload.
|
|
74
80
|
* @throws {AssemblyUnauthorizedError} If the token does not represent a client user.
|
|
@@ -85,6 +85,14 @@ var AssemblyToken = class AssemblyToken {
|
|
|
85
85
|
return this.payload.internalUserId !== void 0;
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
+
* `true` when an internal user is proxying as a client (CRM "preview as client"):
|
|
89
|
+
* both `internalUserId` and `clientId` are present. Both `isClientUser` and
|
|
90
|
+
* `isInternalUser` are also `true` in this case — branch on this getter first.
|
|
91
|
+
*/
|
|
92
|
+
get isProxying() {
|
|
93
|
+
return this.payload.internalUserId !== void 0 && this.payload.clientId !== void 0;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
88
96
|
* Assert that the token belongs to a client user and return the narrowed payload.
|
|
89
97
|
* @throws {AssemblyUnauthorizedError} If the token does not represent a client user.
|
|
90
98
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly-token.mjs","names":["#store"],"sources":["../../src/token/assembly-token.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { AssemblyInvalidTokenError } from \"src/errors/invalid-token\";\nimport { AssemblyNoTokenError } from \"src/errors/no-token\";\nimport { AssemblyUnauthorizedError } from \"src/errors/unauthorized\";\nimport type { TokenPayload } from \"src/schemas/shared/token\";\n\nimport { decrypt, validatePayload } from \"./parse\";\n\n/** A token payload that identifies a client (portal) user. */\nexport interface ClientTokenPayload extends TokenPayload {\n clientId: string;\n companyId?: string;\n}\n\n/** A token payload that identifies an internal (team member) user. */\nexport interface InternalUserTokenPayload extends TokenPayload {\n internalUserId: string;\n}\n\n/**\n * Decrypts and validates an Assembly token, exposing the payload with\n * convenience getters for identity checks and compound key building.\n *\n * Use `AssemblyToken.run()` to store a request-scoped instance via\n * `AsyncLocalStorage`, then retrieve it anywhere with `AssemblyToken.current()`.\n * This is safe for Vercel fluid compute — no shared state across requests.\n *\n * @example\n * ```ts\n * // Request-scoped (recommended for serverless)\n * const t = AssemblyToken.new({ token: encryptedHex, apiKey });\n * const same = AssemblyToken.new({ token: encryptedHex, apiKey }); // returns the same instance\n *\n * // Direct instantiation (always creates a new instance)\n * const token = new AssemblyToken({ token: encryptedHex, apiKey });\n * ```\n *\n * @throws {AssemblyNoTokenError} If `token` is nullish or empty.\n * @throws {AssemblyInvalidTokenError} If decryption, JSON parsing, or schema validation fails.\n */\nexport class AssemblyToken {\n static readonly #store: AsyncLocalStorage<AssemblyToken> = new AsyncLocalStorage<AssemblyToken>();\n\n readonly currentToken: string;\n readonly payload: TokenPayload;\n\n constructor({ token, apiKey }: { token: unknown; apiKey: string }) {\n if (token === undefined || token === null || token === \"\") {\n throw new AssemblyNoTokenError();\n }\n\n if (typeof token !== \"string\") {\n throw new AssemblyInvalidTokenError({\n message: `Expected token to be a string, got ${typeof token}`,\n });\n }\n\n this.currentToken = token;\n this.payload = validatePayload(decrypt({ apiKey, token }));\n }\n\n /**\n * Get or create a request-scoped `AssemblyToken` instance via `AsyncLocalStorage`.\n * Returns the existing instance if one exists with the same token. If the token\n * differs, a new instance is created and replaces the previous one.\n *\n * @returns The `AssemblyToken` instance for the current async context.\n */\n static new(options: { token: unknown; apiKey: string }): AssemblyToken {\n const existing = AssemblyToken.#store.getStore();\n if (existing && existing.currentToken === options.token) {\n return existing;\n }\n const instance = new AssemblyToken(options);\n AssemblyToken.#store.enterWith(instance);\n return instance;\n }\n\n /** The workspace ID embedded in the token. Always present. */\n get workspaceId(): string {\n return this.payload.workspaceId;\n }\n\n /** The token ID, if present (used in marketplace compound keys). */\n get tokenId(): string | undefined {\n return this.payload.tokenId;\n }\n\n /** The API base URL override, if present. */\n get baseUrl(): string | undefined {\n return this.payload.baseUrl;\n }\n\n /** The client (portal user) ID, if present. */\n get clientId(): string | undefined {\n return this.payload.clientId;\n }\n\n /** The company ID associated with the client, if present. */\n get companyId(): string | undefined {\n return this.payload.companyId;\n }\n\n /** The internal (team member) user ID, if present. */\n get internalUserId(): string | undefined {\n return this.payload.internalUserId;\n }\n\n /** `true` when the token belongs to a client (portal) user. */\n get isClientUser(): boolean {\n return this.payload.clientId !== undefined;\n }\n\n /** `true` when the token belongs to an internal (team member) user. */\n get isInternalUser(): boolean {\n return this.payload.internalUserId !== undefined;\n }\n\n /**\n * Assert that the token belongs to a client user and return the narrowed payload.\n * @throws {AssemblyUnauthorizedError} If the token does not represent a client user.\n */\n ensureIsClient(): ClientTokenPayload {\n if (!this.isClientUser) {\n throw new AssemblyUnauthorizedError({\n message:\n \"This operation requires a client token (clientId), but the token does not contain a clientId\",\n });\n }\n return this.payload as ClientTokenPayload;\n }\n\n /**\n * Assert that the token belongs to an internal (team member) user and return the narrowed payload.\n * @throws {AssemblyUnauthorizedError} If the token does not represent an internal user.\n */\n ensureIsInternalUser(): InternalUserTokenPayload {\n if (!this.isInternalUser) {\n throw new AssemblyUnauthorizedError({\n message:\n \"This operation requires an internal user token (internalUserId), but the token does not contain an internalUserId\",\n });\n }\n return this.payload as InternalUserTokenPayload;\n }\n\n /**\n * Build the compound API key sent in the `X-API-Key` header.\n *\n * - With `tokenId`: `{workspaceId}/{apiKey}/{tokenId}`\n * - Without `tokenId`: `{workspaceId}/{apiKey}`\n */\n buildCompoundKey({ apiKey }: { apiKey: string }): string {\n if (this.payload.tokenId) {\n return `${this.payload.workspaceId}/${apiKey}/${this.payload.tokenId}`;\n }\n return `${this.payload.workspaceId}/${apiKey}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,gBAAb,MAAa,cAAc;CACzB,QAAA,QAA2D,IAAI,mBAAkC;CAEjG;CACA;CAEA,YAAY,EAAE,OAAO,UAA8C;AACjE,MAAI,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU,GACrD,OAAM,IAAI,sBAAsB;AAGlC,MAAI,OAAO,UAAU,SACnB,OAAM,IAAI,0BAA0B,EAClC,SAAS,sCAAsC,OAAO,SACvD,CAAC;AAGJ,OAAK,eAAe;AACpB,OAAK,UAAU,gBAAgB,QAAQ;GAAE;GAAQ;GAAO,CAAC,CAAC;;;;;;;;;CAU5D,OAAO,IAAI,SAA4D;EACrE,MAAM,WAAW,eAAA,MAAqB,UAAU;AAChD,MAAI,YAAY,SAAS,iBAAiB,QAAQ,MAChD,QAAO;EAET,MAAM,WAAW,IAAI,cAAc,QAAQ;AAC3C,iBAAA,MAAqB,UAAU,SAAS;AACxC,SAAO;;;CAIT,IAAI,cAAsB;AACxB,SAAO,KAAK,QAAQ;;;CAItB,IAAI,UAA8B;AAChC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,UAA8B;AAChC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,WAA+B;AACjC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,YAAgC;AAClC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,iBAAqC;AACvC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,eAAwB;AAC1B,SAAO,KAAK,QAAQ,aAAa,KAAA;;;CAInC,IAAI,iBAA0B;AAC5B,SAAO,KAAK,QAAQ,mBAAmB,KAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"assembly-token.mjs","names":["#store"],"sources":["../../src/token/assembly-token.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { AssemblyInvalidTokenError } from \"src/errors/invalid-token\";\nimport { AssemblyNoTokenError } from \"src/errors/no-token\";\nimport { AssemblyUnauthorizedError } from \"src/errors/unauthorized\";\nimport type { TokenPayload } from \"src/schemas/shared/token\";\n\nimport { decrypt, validatePayload } from \"./parse\";\n\n/** A token payload that identifies a client (portal) user. */\nexport interface ClientTokenPayload extends TokenPayload {\n clientId: string;\n companyId?: string;\n}\n\n/** A token payload that identifies an internal (team member) user. */\nexport interface InternalUserTokenPayload extends TokenPayload {\n internalUserId: string;\n}\n\n/**\n * Decrypts and validates an Assembly token, exposing the payload with\n * convenience getters for identity checks and compound key building.\n *\n * Use `AssemblyToken.run()` to store a request-scoped instance via\n * `AsyncLocalStorage`, then retrieve it anywhere with `AssemblyToken.current()`.\n * This is safe for Vercel fluid compute — no shared state across requests.\n *\n * @example\n * ```ts\n * // Request-scoped (recommended for serverless)\n * const t = AssemblyToken.new({ token: encryptedHex, apiKey });\n * const same = AssemblyToken.new({ token: encryptedHex, apiKey }); // returns the same instance\n *\n * // Direct instantiation (always creates a new instance)\n * const token = new AssemblyToken({ token: encryptedHex, apiKey });\n * ```\n *\n * @throws {AssemblyNoTokenError} If `token` is nullish or empty.\n * @throws {AssemblyInvalidTokenError} If decryption, JSON parsing, or schema validation fails.\n */\nexport class AssemblyToken {\n static readonly #store: AsyncLocalStorage<AssemblyToken> = new AsyncLocalStorage<AssemblyToken>();\n\n readonly currentToken: string;\n readonly payload: TokenPayload;\n\n constructor({ token, apiKey }: { token: unknown; apiKey: string }) {\n if (token === undefined || token === null || token === \"\") {\n throw new AssemblyNoTokenError();\n }\n\n if (typeof token !== \"string\") {\n throw new AssemblyInvalidTokenError({\n message: `Expected token to be a string, got ${typeof token}`,\n });\n }\n\n this.currentToken = token;\n this.payload = validatePayload(decrypt({ apiKey, token }));\n }\n\n /**\n * Get or create a request-scoped `AssemblyToken` instance via `AsyncLocalStorage`.\n * Returns the existing instance if one exists with the same token. If the token\n * differs, a new instance is created and replaces the previous one.\n *\n * @returns The `AssemblyToken` instance for the current async context.\n */\n static new(options: { token: unknown; apiKey: string }): AssemblyToken {\n const existing = AssemblyToken.#store.getStore();\n if (existing && existing.currentToken === options.token) {\n return existing;\n }\n const instance = new AssemblyToken(options);\n AssemblyToken.#store.enterWith(instance);\n return instance;\n }\n\n /** The workspace ID embedded in the token. Always present. */\n get workspaceId(): string {\n return this.payload.workspaceId;\n }\n\n /** The token ID, if present (used in marketplace compound keys). */\n get tokenId(): string | undefined {\n return this.payload.tokenId;\n }\n\n /** The API base URL override, if present. */\n get baseUrl(): string | undefined {\n return this.payload.baseUrl;\n }\n\n /** The client (portal user) ID, if present. */\n get clientId(): string | undefined {\n return this.payload.clientId;\n }\n\n /** The company ID associated with the client, if present. */\n get companyId(): string | undefined {\n return this.payload.companyId;\n }\n\n /** The internal (team member) user ID, if present. */\n get internalUserId(): string | undefined {\n return this.payload.internalUserId;\n }\n\n /** `true` when the token belongs to a client (portal) user. */\n get isClientUser(): boolean {\n return this.payload.clientId !== undefined;\n }\n\n /** `true` when the token belongs to an internal (team member) user. */\n get isInternalUser(): boolean {\n return this.payload.internalUserId !== undefined;\n }\n\n /**\n * `true` when an internal user is proxying as a client (CRM \"preview as client\"):\n * both `internalUserId` and `clientId` are present. Both `isClientUser` and\n * `isInternalUser` are also `true` in this case — branch on this getter first.\n */\n get isProxying(): boolean {\n return this.payload.internalUserId !== undefined && this.payload.clientId !== undefined;\n }\n\n /**\n * Assert that the token belongs to a client user and return the narrowed payload.\n * @throws {AssemblyUnauthorizedError} If the token does not represent a client user.\n */\n ensureIsClient(): ClientTokenPayload {\n if (!this.isClientUser) {\n throw new AssemblyUnauthorizedError({\n message:\n \"This operation requires a client token (clientId), but the token does not contain a clientId\",\n });\n }\n return this.payload as ClientTokenPayload;\n }\n\n /**\n * Assert that the token belongs to an internal (team member) user and return the narrowed payload.\n * @throws {AssemblyUnauthorizedError} If the token does not represent an internal user.\n */\n ensureIsInternalUser(): InternalUserTokenPayload {\n if (!this.isInternalUser) {\n throw new AssemblyUnauthorizedError({\n message:\n \"This operation requires an internal user token (internalUserId), but the token does not contain an internalUserId\",\n });\n }\n return this.payload as InternalUserTokenPayload;\n }\n\n /**\n * Build the compound API key sent in the `X-API-Key` header.\n *\n * - With `tokenId`: `{workspaceId}/{apiKey}/{tokenId}`\n * - Without `tokenId`: `{workspaceId}/{apiKey}`\n */\n buildCompoundKey({ apiKey }: { apiKey: string }): string {\n if (this.payload.tokenId) {\n return `${this.payload.workspaceId}/${apiKey}/${this.payload.tokenId}`;\n }\n return `${this.payload.workspaceId}/${apiKey}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,gBAAb,MAAa,cAAc;CACzB,QAAA,QAA2D,IAAI,mBAAkC;CAEjG;CACA;CAEA,YAAY,EAAE,OAAO,UAA8C;AACjE,MAAI,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU,GACrD,OAAM,IAAI,sBAAsB;AAGlC,MAAI,OAAO,UAAU,SACnB,OAAM,IAAI,0BAA0B,EAClC,SAAS,sCAAsC,OAAO,SACvD,CAAC;AAGJ,OAAK,eAAe;AACpB,OAAK,UAAU,gBAAgB,QAAQ;GAAE;GAAQ;GAAO,CAAC,CAAC;;;;;;;;;CAU5D,OAAO,IAAI,SAA4D;EACrE,MAAM,WAAW,eAAA,MAAqB,UAAU;AAChD,MAAI,YAAY,SAAS,iBAAiB,QAAQ,MAChD,QAAO;EAET,MAAM,WAAW,IAAI,cAAc,QAAQ;AAC3C,iBAAA,MAAqB,UAAU,SAAS;AACxC,SAAO;;;CAIT,IAAI,cAAsB;AACxB,SAAO,KAAK,QAAQ;;;CAItB,IAAI,UAA8B;AAChC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,UAA8B;AAChC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,WAA+B;AACjC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,YAAgC;AAClC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,iBAAqC;AACvC,SAAO,KAAK,QAAQ;;;CAItB,IAAI,eAAwB;AAC1B,SAAO,KAAK,QAAQ,aAAa,KAAA;;;CAInC,IAAI,iBAA0B;AAC5B,SAAO,KAAK,QAAQ,mBAAmB,KAAA;;;;;;;CAQzC,IAAI,aAAsB;AACxB,SAAO,KAAK,QAAQ,mBAAmB,KAAA,KAAa,KAAK,QAAQ,aAAa,KAAA;;;;;;CAOhF,iBAAqC;AACnC,MAAI,CAAC,KAAK,aACR,OAAM,IAAI,0BAA0B,EAClC,SACE,gGACH,CAAC;AAEJ,SAAO,KAAK;;;;;;CAOd,uBAAiD;AAC/C,MAAI,CAAC,KAAK,eACR,OAAM,IAAI,0BAA0B,EAClC,SACE,qHACH,CAAC;AAEJ,SAAO,KAAK;;;;;;;;CASd,iBAAiB,EAAE,UAAsC;AACvD,MAAI,KAAK,QAAQ,QACf,QAAO,GAAG,KAAK,QAAQ,YAAY,GAAG,OAAO,GAAG,KAAK,QAAQ;AAE/D,SAAO,GAAG,KAAK,QAAQ,YAAY,GAAG"}
|
package/dist/version.mjs
CHANGED
package/dist/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["/** SDK version string sent with every API request. */\nexport const SDK_VERSION: string = \"
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["/** SDK version string sent with every API request. */\nexport const SDK_VERSION: string = \"0.1.0\"; // x-release-please-version\n"],"mappings":";;AACA,MAAa,cAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assembly-kit",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "TypeScript SDK for the Assembly platform",
|
|
5
5
|
"homepage": "https://github.com/madebyoutside/assembly-kit#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"dev": "vp pack --watch",
|
|
35
35
|
"test": "vp test",
|
|
36
36
|
"check": "vp check",
|
|
37
|
-
"release": "bumpp --commit --push --tag",
|
|
38
37
|
"prepublishOnly": "vp run build",
|
|
39
38
|
"prepare": "vp config"
|
|
40
39
|
},
|
|
@@ -47,7 +46,6 @@
|
|
|
47
46
|
"@types/node": "^25.6.0",
|
|
48
47
|
"@types/react": "^19.2.14",
|
|
49
48
|
"@typescript/native-preview": "7.0.0-dev.20260505.1",
|
|
50
|
-
"bumpp": "^11.0.1",
|
|
51
49
|
"pino": "^10.3.1",
|
|
52
50
|
"pino-pretty": "^13.1.2",
|
|
53
51
|
"react": "^19.2.5",
|