@reopt-ai/workspace-sdk 0.1.0-rc.12 → 0.1.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +6 -2
- package/dist/{client-CJekFhCW.js → client-BX4VHJS6.js} +3 -3
- package/dist/{connect-3zkyD_-0.d.ts → connect-CTxppAjD.d.ts} +56 -3
- package/dist/connect.d.ts +3 -3
- package/dist/connect.js +2 -2
- package/dist/{errors-CkgGRAPR.js → errors-DKMC4kId.js} +2 -2
- package/dist/forms.d.ts +167 -0
- package/dist/forms.js +221 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/installation/index.js +1 -1
- package/dist/{page-CV3oG_Zu.js → page-rc95cliL.js} +32 -4
- package/dist/{permissions-LF1orSvQ.d.ts → permissions-DKm_zC_X.d.ts} +2 -2
- package/dist/permissions.d.ts +1 -1
- package/dist/permissions.js +24 -0
- package/dist/social/index.js +2 -2
- package/dist/testing/index.d.ts +22 -3
- package/dist/testing/index.js +105 -15
- package/dist/{transport-BVPl0lgF.js → transport-BEwY_twi.js} +2 -2
- package/docs/forms.md +100 -0
- package/docs/testing.md +10 -6
- package/docs/workspace.md +31 -0
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ConnectOperationRule, c as WorkspacePermissionKey, d as canAny, f as canCall, i as ConnectOperation, l as can, n as CONNECT_OPERATION_NAMES, o as ConnectScope, r as CONNECT_SCOPES, s as WORKSPACE_PERMISSION_KEYS, t as CONNECT_OPERATIONS, u as canAll } from "./permissions-
|
|
1
|
+
import { a as ConnectOperationRule, c as WorkspacePermissionKey, d as canAny, f as canCall, i as ConnectOperation, l as can, n as CONNECT_OPERATION_NAMES, o as ConnectScope, r as CONNECT_SCOPES, s as WORKSPACE_PERMISSION_KEYS, t as CONNECT_OPERATIONS, u as canAll } from "./permissions-DKm_zC_X.js";
|
|
2
2
|
import { a as iterate, i as SortOf, n as Page, o as listAll, r as PageQuery, t as CountedPage } from "./page-j1OCu4of.js";
|
|
3
3
|
import { a as PlatformSdkErrorCode, c as isNotImplemented, d as isPlatformError, f as isSignInRequired, i as PlatformFieldError, l as isPermissionDenied, n as PlatformApiError, o as PlatformServerErrorCode, r as PlatformErrorCode, s as SDK_ERROR_CODES, t as PLATFORM_ERROR_CODES, u as isPlatformApiError } from "./errors-CLUuzCNG.js";
|
|
4
|
-
import { $ as
|
|
4
|
+
import { $ as ConnectStageColor, A as ConnectInquiryMoveResult, At as connectPostGroupSchema, B as ConnectPostGroup, C as ConnectFolder, Ct as connectInquiryDetailSchema, D as ConnectFormType, Dt as connectMemberSchema, E as ConnectFormStatus, Et as connectMeSchema, F as ConnectNotificationKind, Ft as connectTaskFeedItemSchema, G as ConnectPostSpec, H as ConnectPostListQuery, I as ConnectPipeline, It as connectTaskSchema, J as ConnectPostTag, K as ConnectPostStatus, L as ConnectPost, Lt as createConnectClient, M as ConnectMember, Mt as connectPostSummarySchema, N as ConnectMemberRole, Nt as connectPostTagSchema, O as ConnectInquiry, Ot as connectNotificationSchema, P as ConnectNotification, Pt as connectTaskCommentSchema, Q as ConnectSignedUrlOptions, R as ConnectPostAuthor, S as ConnectFileVisibility, St as connectFormSchema, T as ConnectForm, Tt as connectInquirySchema, U as ConnectPostMetaInput, V as ConnectPostGroupKind, W as ConnectPostSortField, X as ConnectRequestOptions, Y as ConnectPostUpdateInput, Z as ConnectSignedUrl, _ as ConnectEavRecord, _t as connectEavEntitySchema, a as ConnectClientConfig, at as ConnectTaskFeedItem, b as ConnectFileSortField, bt as connectFileUsageSchema, c as ConnectCustomerEvent, ct as ConnectTaskMoveInput, d as ConnectCustomerNote, dt as ConnectTaskUpdateInput, et as ConnectStageOutcome, f as ConnectCustomerRecord, ft as ConnectWorkspaceTier, g as ConnectEavEntity, gt as connectCustomerSummarySchema, h as ConnectCustomerUpdateInput, ht as connectCustomerSchema, i as ConnectClient, it as ConnectTaskCreateInput, j as ConnectMe, jt as connectPostSchema, k as ConnectInquiryDetail, kt as connectPipelineSchema, l as ConnectCustomerField, lt as ConnectTaskPriority, m as ConnectCustomerTag, mt as connectCustomerNoteSchema, n as ConnectAnswerValue, nt as ConnectTaskActivity, o as ConnectCustomer, ot as ConnectTaskFeedMember, p as ConnectCustomerSummary, pt as connectBrandSchema, q as ConnectPostSummary, r as ConnectBrand, rt as ConnectTaskComment, s as ConnectCustomerCreateInput, st as ConnectTaskListQuery, t as ConnectAccessToken, tt as ConnectTask, u as ConnectCustomerListQuery, ut as ConnectTaskSortField, v as ConnectFile, vt as connectEavRecordSchema, w as ConnectFolderKind, wt as connectInquiryMoveResultSchema, x as ConnectFileUsage, xt as connectFolderSchema, y as ConnectFileListQuery, yt as connectFileSchema, z as ConnectPostCreateInput } from "./connect-CTxppAjD.js";
|
|
5
5
|
import { n as mentionToken, r as splitMentions, t as MentionSegment } from "./mentions-BMI2c7O6.js";
|
|
6
6
|
import { a as REOPT_PLATFORM_URLS, c as resolvePlatformUrls, i as REOPT_PLATFORM_ID_URLS, n as PlatformUrls } from "./urls-DiYp_PHg.js";
|
|
7
7
|
import { $ as PlatformStageColor, A as PlatformEavSchemaApplyResult, At as platformOAuthClientUpsertInputSchema, B as PlatformOAuthClientUpsertInput, Bt as platformPublishedPostSummarySchema, C as PlatformBrandappUpsertInput, Ct as platformErrorSchema, D as PlatformEavDataType, Dt as platformMeSchema, E as PlatformEavBrandappResources, Et as platformLockReleasedSchema, F as PlatformManagedBy, Ft as platformPipelineUpsertInputSchema, G as PlatformPipelineUpsertInput, Gt as platformTaskStageInputSchema, H as PlatformPipelineImportInput, Ht as platformResourcesSchema, I as PlatformMe, It as platformPublishedPostDetailQuerySchema, J as PlatformPublishedPostListOptions, Jt as platformWebhookResourceSchema, K as PlatformPublishedPost, Kt as platformTaskStageSchema, L as PlatformOAuthClientImportInput, Lt as platformPublishedPostListQuerySchema, M as PlatformErrorBody, Mt as platformPipelineResourceSchema, N as PlatformLockAcquired, Nt as platformPipelineSchema, O as PlatformEavEntityResource, Ot as platformOAuthClientImportInputSchema, P as PlatformLockReleased, Pt as platformPipelineStageInputSchema, Q as PlatformResourcesV2, Qt as platformWriteMetaSchema, R as PlatformOAuthClientPurpose, Rt as platformPublishedPostPageSchema, S as PlatformBrandappResource, St as platformEavSchemaOperationSchema, T as PlatformDomainStatus, Tt as platformLockAcquiredSchema, U as PlatformPipelineResource, Ut as platformResourcesV2Schema, V as PlatformPipeline, Vt as platformResourceKeySchema, W as PlatformPipelineStageInput, Wt as platformTaskSchema, X as PlatformPublishedPostSummary, Xt as platformWebhookUpsertInputSchema, Y as PlatformPublishedPostPage, Yt as platformWebhookSchema, Z as PlatformResources, Zt as platformWorkTaskStageChangedEventSchema, _ as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, _t as platformCustomerUpsertInputSchema, a as createPlatformClient, at as PlatformTaskUpsertInput, b as PlatformBrandResource, bt as platformEavSchemaApplyInputSchema, c as PLATFORM_DOMAIN_STATUSES, ct as PlatformWebhookTrigger, d as PLATFORM_OAUTH_APPLICATION_TYPES, dt as PlatformWriteMeta, et as PlatformTask, f as PLATFORM_OAUTH_CLIENT_PURPOSES, ft as platformBrandImportInputSchema, g as PLATFORM_TASK_PRIORITIES, gt as platformBrandappUpsertInputSchema, h as PLATFORM_TASK_OUTCOMES, ht as platformBrandappResourceSchema, i as PlatformWriteResult, it as PlatformTaskStageInput, j as PlatformEavSchemaOperation, jt as platformPipelineImportInputSchema, k as PlatformEavSchemaApplyInput, kt as platformOAuthClientResourceSchema, l as PLATFORM_EAV_DATA_TYPES, lt as PlatformWebhookUpsertInput, m as PLATFORM_STAGE_COLORS, mt as platformBrandUpsertInputSchema, n as PlatformClient, nt as PlatformTaskPriority, o as PLATFORM_ADMIN_SCOPE, ot as PlatformWebhook, p as PLATFORM_OAUTH_GRANT_TYPES, pt as platformBrandResourceSchema, q as PlatformPublishedPostGetOptions, qt as platformTaskUpsertInputSchema, r as PlatformClientConfig, rt as PlatformTaskStage, s as PLATFORM_BRANDAPP_STATUSES, st as PlatformWebhookResource, t as DEFAULT_PLATFORM_SCOPES, tt as PlatformTaskOutcome, u as PLATFORM_MANAGED_BY_VALUES, ut as PlatformWorkTaskStageChangedEvent, v as PLATFORM_WEBHOOK_TRIGGERS, vt as platformEavBrandappResourcesSchema, w as PlatformCustomerUpsertInput, wt as platformExternalIdSchema, x as PlatformBrandUpsertInput, xt as platformEavSchemaApplyResultSchema, y as PlatformBrandImportInput, yt as platformEavEntityResourceSchema, z as PlatformOAuthClientResource, zt as platformPublishedPostSchema } from "./client-olMIaJZH.js";
|
|
8
|
-
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, type ConnectAccessToken, type ConnectAnswerValue, type ConnectBrand, type ConnectClient, type ConnectClientConfig, type ConnectCustomer, type ConnectCustomerCreateInput, type ConnectCustomerEvent, type ConnectCustomerField, type ConnectCustomerListQuery, type ConnectCustomerNote, type ConnectCustomerRecord, type ConnectCustomerSummary, type ConnectCustomerTag, type ConnectCustomerUpdateInput, type ConnectEavEntity, type ConnectEavRecord, type ConnectFile, type ConnectFileListQuery, type ConnectFileSortField, type ConnectFileUsage, type ConnectFileVisibility, type ConnectFolder, type ConnectFolderKind, type ConnectForm, type ConnectFormStatus, type ConnectFormType, type ConnectInquiry, type ConnectInquiryDetail, type ConnectInquiryMoveResult, type ConnectMe, type ConnectMember, type ConnectMemberRole, type ConnectOperation, type ConnectOperationRule, type ConnectPipeline, type ConnectPost, type ConnectPostAuthor, type ConnectPostCreateInput, type ConnectPostGroup, type ConnectPostGroupKind, type ConnectPostListQuery, type ConnectPostMetaInput, type ConnectPostSortField, type ConnectPostSpec, type ConnectPostStatus, type ConnectPostSummary, type ConnectPostTag, type ConnectPostUpdateInput, type ConnectRequestOptions, type ConnectScope, type ConnectSignedUrl, type ConnectSignedUrlOptions, type ConnectStageColor, type ConnectStageOutcome, type ConnectTask, type ConnectTaskActivity, type ConnectTaskComment, type ConnectTaskCreateInput, type ConnectTaskFeedItem, type ConnectTaskFeedMember, type ConnectTaskListQuery, type ConnectTaskMoveInput, type ConnectTaskPriority, type ConnectTaskSortField, type ConnectTaskUpdateInput, type ConnectWorkspaceTier, type CountedPage, DEFAULT_PLATFORM_SCOPES, type MentionSegment, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, type Page, type PageQuery, PlatformApiError, type PlatformBrandImportInput, type PlatformBrandResource, type PlatformBrandUpsertInput, type PlatformBrandappResource, type PlatformBrandappUpsertInput, type PlatformClient, type PlatformClientConfig, type PlatformCustomerUpsertInput, type PlatformDomainStatus, type PlatformEavBrandappResources, type PlatformEavDataType, type PlatformEavEntityResource, type PlatformEavSchemaApplyInput, type PlatformEavSchemaApplyResult, type PlatformEavSchemaOperation, type PlatformErrorBody, type PlatformErrorCode, type PlatformFieldError, type PlatformLockAcquired, type PlatformLockReleased, type PlatformManagedBy, type PlatformMe, type PlatformOAuthClientImportInput, type PlatformOAuthClientPurpose, type PlatformOAuthClientResource, type PlatformOAuthClientUpsertInput, type PlatformPipeline, type PlatformPipelineImportInput, type PlatformPipelineResource, type PlatformPipelineStageInput, type PlatformPipelineUpsertInput, type PlatformPublishedPost, type PlatformPublishedPostGetOptions, type PlatformPublishedPostListOptions, type PlatformPublishedPostPage, type PlatformPublishedPostSummary, type PlatformResources, type PlatformResourcesV2, type PlatformSdkErrorCode, type PlatformServerErrorCode, type PlatformStageColor, type PlatformTask, type PlatformTaskOutcome, type PlatformTaskPriority, type PlatformTaskStage, type PlatformTaskStageInput, type PlatformTaskUpsertInput, type PlatformUrls, type PlatformWebhook, type PlatformWebhookResource, type PlatformWebhookTrigger, type PlatformWebhookUpsertInput, type PlatformWorkTaskStageChangedEvent, type PlatformWriteMeta, type PlatformWriteResult, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, SDK_ERROR_CODES, type SortOf, WORKSPACE_PERMISSION_KEYS, type WorkspacePermissionKey, can, canAll, canAny, canCall, connectBrandSchema, type connectCustomerNoteSchema, type connectCustomerSchema, type connectCustomerSummarySchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, type connectInquiryMoveResultSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, type connectTaskCommentSchema, type connectTaskFeedItemSchema, connectTaskSchema, createConnectClient, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls, splitMentions };
|
|
8
|
+
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, type ConnectAccessToken, type ConnectAnswerValue, type ConnectBrand, type ConnectClient, type ConnectClientConfig, type ConnectCustomer, type ConnectCustomerCreateInput, type ConnectCustomerEvent, type ConnectCustomerField, type ConnectCustomerListQuery, type ConnectCustomerNote, type ConnectCustomerRecord, type ConnectCustomerSummary, type ConnectCustomerTag, type ConnectCustomerUpdateInput, type ConnectEavEntity, type ConnectEavRecord, type ConnectFile, type ConnectFileListQuery, type ConnectFileSortField, type ConnectFileUsage, type ConnectFileVisibility, type ConnectFolder, type ConnectFolderKind, type ConnectForm, type ConnectFormStatus, type ConnectFormType, type ConnectInquiry, type ConnectInquiryDetail, type ConnectInquiryMoveResult, type ConnectMe, type ConnectMember, type ConnectMemberRole, type ConnectNotification, type ConnectNotificationKind, type ConnectOperation, type ConnectOperationRule, type ConnectPipeline, type ConnectPost, type ConnectPostAuthor, type ConnectPostCreateInput, type ConnectPostGroup, type ConnectPostGroupKind, type ConnectPostListQuery, type ConnectPostMetaInput, type ConnectPostSortField, type ConnectPostSpec, type ConnectPostStatus, type ConnectPostSummary, type ConnectPostTag, type ConnectPostUpdateInput, type ConnectRequestOptions, type ConnectScope, type ConnectSignedUrl, type ConnectSignedUrlOptions, type ConnectStageColor, type ConnectStageOutcome, type ConnectTask, type ConnectTaskActivity, type ConnectTaskComment, type ConnectTaskCreateInput, type ConnectTaskFeedItem, type ConnectTaskFeedMember, type ConnectTaskListQuery, type ConnectTaskMoveInput, type ConnectTaskPriority, type ConnectTaskSortField, type ConnectTaskUpdateInput, type ConnectWorkspaceTier, type CountedPage, DEFAULT_PLATFORM_SCOPES, type MentionSegment, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, type Page, type PageQuery, PlatformApiError, type PlatformBrandImportInput, type PlatformBrandResource, type PlatformBrandUpsertInput, type PlatformBrandappResource, type PlatformBrandappUpsertInput, type PlatformClient, type PlatformClientConfig, type PlatformCustomerUpsertInput, type PlatformDomainStatus, type PlatformEavBrandappResources, type PlatformEavDataType, type PlatformEavEntityResource, type PlatformEavSchemaApplyInput, type PlatformEavSchemaApplyResult, type PlatformEavSchemaOperation, type PlatformErrorBody, type PlatformErrorCode, type PlatformFieldError, type PlatformLockAcquired, type PlatformLockReleased, type PlatformManagedBy, type PlatformMe, type PlatformOAuthClientImportInput, type PlatformOAuthClientPurpose, type PlatformOAuthClientResource, type PlatformOAuthClientUpsertInput, type PlatformPipeline, type PlatformPipelineImportInput, type PlatformPipelineResource, type PlatformPipelineStageInput, type PlatformPipelineUpsertInput, type PlatformPublishedPost, type PlatformPublishedPostGetOptions, type PlatformPublishedPostListOptions, type PlatformPublishedPostPage, type PlatformPublishedPostSummary, type PlatformResources, type PlatformResourcesV2, type PlatformSdkErrorCode, type PlatformServerErrorCode, type PlatformStageColor, type PlatformTask, type PlatformTaskOutcome, type PlatformTaskPriority, type PlatformTaskStage, type PlatformTaskStageInput, type PlatformTaskUpsertInput, type PlatformUrls, type PlatformWebhook, type PlatformWebhookResource, type PlatformWebhookTrigger, type PlatformWebhookUpsertInput, type PlatformWorkTaskStageChangedEvent, type PlatformWriteMeta, type PlatformWriteResult, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, SDK_ERROR_CODES, type SortOf, WORKSPACE_PERMISSION_KEYS, type WorkspacePermissionKey, can, canAll, canAny, canCall, connectBrandSchema, type connectCustomerNoteSchema, type connectCustomerSchema, type connectCustomerSummarySchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, type connectInquiryMoveResultSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, type connectNotificationSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, type connectTaskCommentSchema, type connectTaskFeedItemSchema, connectTaskSchema, createConnectClient, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls, splitMentions };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as isPermissionDenied, c as isSignInRequired, i as isNotImplemented, n as PlatformApiError, o as isPlatformApiError, r as SDK_ERROR_CODES, s as isPlatformError, t as PLATFORM_ERROR_CODES } from "./errors-
|
|
1
|
+
import { a as isPermissionDenied, c as isSignInRequired, i as isNotImplemented, n as PlatformApiError, o as isPlatformApiError, r as SDK_ERROR_CODES, s as isPlatformError, t as PLATFORM_ERROR_CODES } from "./errors-DKMC4kId.js";
|
|
2
2
|
import { REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, resolvePlatformUrls } from "./urls.js";
|
|
3
3
|
import { $ as platformWorkTaskStageChangedEventSchema, A as platformOAuthClientImportInputSchema, B as platformPublishedPostPageSchema, C as platformEavSchemaApplyResultSchema, D as platformLockAcquiredSchema, E as platformExternalIdSchema, F as platformPipelineSchema, G as platformResourcesV2Schema, H as platformPublishedPostSummarySchema, I as platformPipelineStageInputSchema, J as platformTaskStageSchema, K as platformTaskSchema, L as platformPipelineUpsertInputSchema, M as platformOAuthClientUpsertInputSchema, N as platformPipelineImportInputSchema, O as platformLockReleasedSchema, P as platformPipelineResourceSchema, Q as platformWebhookUpsertInputSchema, R as platformPublishedPostDetailQuerySchema, S as platformEavSchemaApplyInputSchema, T as platformErrorSchema, U as platformResourceKeySchema, V as platformPublishedPostSchema, W as platformResourcesSchema, X as platformWebhookResourceSchema, Y as platformTaskUpsertInputSchema, Z as platformWebhookSchema, _ as platformBrandappResourceSchema, a as PLATFORM_MANAGED_BY_VALUES, b as platformEavBrandappResourcesSchema, c as PLATFORM_OAUTH_GRANT_TYPES, d as PLATFORM_TASK_PRIORITIES, et as platformWriteMetaSchema, f as PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, g as platformBrandUpsertInputSchema, h as platformBrandResourceSchema, i as PLATFORM_EAV_DATA_TYPES, j as platformOAuthClientResourceSchema, k as platformMeSchema, l as PLATFORM_STAGE_COLORS, m as platformBrandImportInputSchema, n as PLATFORM_BRANDAPP_STATUSES, o as PLATFORM_OAUTH_APPLICATION_TYPES, p as PLATFORM_WEBHOOK_TRIGGERS, q as platformTaskStageInputSchema, r as PLATFORM_DOMAIN_STATUSES, s as PLATFORM_OAUTH_CLIENT_PURPOSES, t as PLATFORM_ADMIN_SCOPE, u as PLATFORM_TASK_OUTCOMES, v as platformBrandappUpsertInputSchema, w as platformEavSchemaOperationSchema, x as platformEavEntityResourceSchema, y as platformCustomerUpsertInputSchema, z as platformPublishedPostListQuerySchema } from "./schemas-eWh_FUfh.js";
|
|
4
|
-
import { n as createPlatformClient, t as DEFAULT_PLATFORM_SCOPES } from "./client-
|
|
4
|
+
import { n as createPlatformClient, t as DEFAULT_PLATFORM_SCOPES } from "./client-BX4VHJS6.js";
|
|
5
5
|
import { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, WORKSPACE_PERMISSION_KEYS, can, canAll, canAny, canCall } from "./permissions.js";
|
|
6
6
|
import { mentionToken, splitMentions } from "./mentions.js";
|
|
7
|
-
import { _ as connectPostSummarySchema, a as connectEavRecordSchema, b as createConnectClient, c as connectFolderSchema, d as connectInquirySchema, f as connectMeSchema, g as connectPostSchema, h as connectPostGroupSchema, i as connectEavEntitySchema, l as connectFormSchema, m as connectPipelineSchema, n as listAll, o as connectFileSchema, p as connectMemberSchema, r as connectBrandSchema, s as connectFileUsageSchema, t as iterate, u as connectInquiryDetailSchema, v as connectPostTagSchema, y as connectTaskSchema } from "./page-
|
|
7
|
+
import { _ as connectPostSummarySchema, a as connectEavRecordSchema, b as createConnectClient, c as connectFolderSchema, d as connectInquirySchema, f as connectMeSchema, g as connectPostSchema, h as connectPostGroupSchema, i as connectEavEntitySchema, l as connectFormSchema, m as connectPipelineSchema, n as listAll, o as connectFileSchema, p as connectMemberSchema, r as connectBrandSchema, s as connectFileUsageSchema, t as iterate, u as connectInquiryDetailSchema, v as connectPostTagSchema, y as connectTaskSchema } from "./page-rc95cliL.js";
|
|
8
8
|
|
|
9
9
|
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, DEFAULT_PLATFORM_SCOPES, PLATFORM_ADMIN_SCOPE, PLATFORM_BRANDAPP_STATUSES, PLATFORM_DOMAIN_STATUSES, PLATFORM_EAV_DATA_TYPES, PLATFORM_ERROR_CODES, PLATFORM_MANAGED_BY_VALUES, PLATFORM_OAUTH_APPLICATION_TYPES, PLATFORM_OAUTH_CLIENT_PURPOSES, PLATFORM_OAUTH_GRANT_TYPES, PLATFORM_STAGE_COLORS, PLATFORM_TASK_OUTCOMES, PLATFORM_TASK_PRIORITIES, PLATFORM_TOKEN_ENDPOINT_AUTH_METHODS, PLATFORM_WEBHOOK_TRIGGERS, PlatformApiError, REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, SDK_ERROR_CODES, WORKSPACE_PERMISSION_KEYS, can, canAll, canAny, canCall, connectBrandSchema, connectEavEntitySchema, connectEavRecordSchema, connectFileSchema, connectFileUsageSchema, connectFolderSchema, connectFormSchema, connectInquiryDetailSchema, connectInquirySchema, connectMeSchema, connectMemberSchema, connectPipelineSchema, connectPostGroupSchema, connectPostSchema, connectPostSummarySchema, connectPostTagSchema, connectTaskSchema, createConnectClient, createPlatformClient, isNotImplemented, isPermissionDenied, isPlatformApiError, isPlatformError, isSignInRequired, iterate, listAll, mentionToken, platformBrandImportInputSchema, platformBrandResourceSchema, platformBrandUpsertInputSchema, platformBrandappResourceSchema, platformBrandappUpsertInputSchema, platformCustomerUpsertInputSchema, platformEavBrandappResourcesSchema, platformEavEntityResourceSchema, platformEavSchemaApplyInputSchema, platformEavSchemaApplyResultSchema, platformEavSchemaOperationSchema, platformErrorSchema, platformExternalIdSchema, platformLockAcquiredSchema, platformLockReleasedSchema, platformMeSchema, platformOAuthClientImportInputSchema, platformOAuthClientResourceSchema, platformOAuthClientUpsertInputSchema, platformPipelineImportInputSchema, platformPipelineResourceSchema, platformPipelineSchema, platformPipelineStageInputSchema, platformPipelineUpsertInputSchema, platformPublishedPostDetailQuerySchema, platformPublishedPostListQuerySchema, platformPublishedPostPageSchema, platformPublishedPostSchema, platformPublishedPostSummarySchema, platformResourceKeySchema, platformResourcesSchema, platformResourcesV2Schema, platformTaskSchema, platformTaskStageInputSchema, platformTaskStageSchema, platformTaskUpsertInputSchema, platformWebhookResourceSchema, platformWebhookSchema, platformWebhookUpsertInputSchema, platformWorkTaskStageChangedEventSchema, platformWriteMetaSchema, resolvePlatformUrls, splitMentions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as SDK_VERSION, n as PlatformApiError } from "../errors-
|
|
1
|
+
import { l as SDK_VERSION, n as PlatformApiError } from "../errors-DKMC4kId.js";
|
|
2
2
|
import { resolvePlatformUrls } from "../urls.js";
|
|
3
3
|
import { o as readClientKeyRing } from "../keys--ef_VwZ-.js";
|
|
4
4
|
import { r as createMachineClient } from "../client-BLaFMBbS.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as PlatformApiError } from "./errors-
|
|
2
|
-
import { t as createTransport } from "./transport-
|
|
1
|
+
import { n as PlatformApiError } from "./errors-DKMC4kId.js";
|
|
2
|
+
import { t as createTransport } from "./transport-BEwY_twi.js";
|
|
3
3
|
import { resolvePlatformUrls } from "./urls.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
@@ -217,6 +217,20 @@ const signedUrlSchema = z.looseObject({
|
|
|
217
217
|
url: z.string(),
|
|
218
218
|
expiresAt: z.string()
|
|
219
219
|
});
|
|
220
|
+
const connectNotificationSchema = z.looseObject({
|
|
221
|
+
id: z.string(),
|
|
222
|
+
kind: z.string(),
|
|
223
|
+
subject: z.string().nullable(),
|
|
224
|
+
content: z.string(),
|
|
225
|
+
seenAt: nullableIso,
|
|
226
|
+
createdAt: iso,
|
|
227
|
+
actorName: z.string().nullable(),
|
|
228
|
+
actorImage: z.string().nullable(),
|
|
229
|
+
entity: z.looseObject({
|
|
230
|
+
type: z.string(),
|
|
231
|
+
id: z.string()
|
|
232
|
+
}).nullable()
|
|
233
|
+
});
|
|
220
234
|
const connectFormSchema = z.looseObject({
|
|
221
235
|
id: z.string(),
|
|
222
236
|
name: z.string(),
|
|
@@ -383,7 +397,8 @@ const DEFAULT_LIMIT = {
|
|
|
383
397
|
files: 100,
|
|
384
398
|
inquiries: 100,
|
|
385
399
|
records: 100,
|
|
386
|
-
customers: 50
|
|
400
|
+
customers: 50,
|
|
401
|
+
notifications: 20
|
|
387
402
|
};
|
|
388
403
|
const nextOffsetSchema = z.looseObject({ nextOffset: z.number().nullable().optional() });
|
|
389
404
|
function totalOf(meta) {
|
|
@@ -545,6 +560,19 @@ function createConnectClient(config) {
|
|
|
545
560
|
content: (id, options) => transport.raw("GET", `/files/${enc(id)}/content`, options)
|
|
546
561
|
},
|
|
547
562
|
forms: { list: (options) => page("/forms", connectFormSchema, options) },
|
|
563
|
+
notifications: {
|
|
564
|
+
list: (query = {}, options) => page(`/notifications${queryString({
|
|
565
|
+
unseen: query.unseen ? "true" : void 0,
|
|
566
|
+
limit: query.limit ?? DEFAULT_LIMIT.notifications,
|
|
567
|
+
offset: query.offset
|
|
568
|
+
})}`, connectNotificationSchema, options),
|
|
569
|
+
unseenCount: async (options) => (await one("GET", "/notifications/unseen-count", z.looseObject({ count: z.number() }), options)).count,
|
|
570
|
+
markSeen: (id, options) => one("POST", `/notifications/${enc(id)}/seen`, z.looseObject({
|
|
571
|
+
id: z.string(),
|
|
572
|
+
seenAt: nullableIso
|
|
573
|
+
}), options),
|
|
574
|
+
markAllSeen: (options) => one("POST", "/notifications/seen", z.looseObject({ count: z.number() }), options)
|
|
575
|
+
},
|
|
548
576
|
customers: {
|
|
549
577
|
list: async (query = {}, options) => {
|
|
550
578
|
const { tags, limit, ...rest } = query;
|
|
@@ -640,4 +668,4 @@ async function listAll(fetchPage, query, options = {}) {
|
|
|
640
668
|
|
|
641
669
|
//#endregion
|
|
642
670
|
export { connectPostSummarySchema as _, connectEavRecordSchema as a, createConnectClient as b, connectFolderSchema as c, connectInquirySchema as d, connectMeSchema as f, connectPostSchema as g, connectPostGroupSchema as h, connectEavEntitySchema as i, connectFormSchema as l, connectPipelineSchema as m, listAll as n, connectFileSchema as o, connectMemberSchema as p, connectBrandSchema as r, connectFileUsageSchema as s, iterate as t, connectInquiryDetailSchema as u, connectPostTagSchema as v, connectTaskSchema as y };
|
|
643
|
-
//# sourceMappingURL=page-
|
|
671
|
+
//# sourceMappingURL=page-rc95cliL.js.map
|
|
@@ -34,7 +34,7 @@ declare function canAll(source: PermissionSource, keys: readonly WorkspacePermis
|
|
|
34
34
|
/** 하나라도 가졌는가 */
|
|
35
35
|
declare function canAny(source: PermissionSource, keys: readonly WorkspacePermissionKey[]): boolean;
|
|
36
36
|
/** 위임 클라이언트의 메서드 이름(`createConnectClient`의 경로 그대로) */
|
|
37
|
-
declare const CONNECT_OPERATION_NAMES: readonly ["me", "brands", "members", "works.listPipelines", "works.listTasks", "works.getTask", "works.createTask", "works.updateTask", "works.moveTask", "works.deleteTask", "works.deleteTasks", "works.listFeed", "works.addComment", "works.updateComment", "works.deleteComment", "posts.listGroups", "posts.listTags", "posts.list", "posts.checkSlug", "posts.get", "posts.create", "posts.update", "posts.publish", "posts.unpublish", "posts.delete", "folders.list", "folders.create", "folders.update", "folders.delete", "files.list", "files.usage", "files.signedUrls", "files.upload", "files.get", "files.update", "files.delete", "files.content", "forms.list", "inquiries.list", "inquiries.get", "inquiries.moveStage", "customers.list", "customers.listTags", "customers.listFields", "customers.get", "customers.create", "customers.update", "customers.updateTags", "customers.listNotes", "customers.addNote", "customers.updateNote", "customers.deleteNote", "customers.timeline", "eav.listEntities", "eav.listRecords", "eav.createRecord", "eav.updateRecord", "eav.deleteRecord"];
|
|
37
|
+
declare const CONNECT_OPERATION_NAMES: readonly ["me", "brands", "members", "works.listPipelines", "works.listTasks", "works.getTask", "works.createTask", "works.updateTask", "works.moveTask", "works.deleteTask", "works.deleteTasks", "works.listFeed", "works.addComment", "works.updateComment", "works.deleteComment", "posts.listGroups", "posts.listTags", "posts.list", "posts.checkSlug", "posts.get", "posts.create", "posts.update", "posts.publish", "posts.unpublish", "posts.delete", "folders.list", "folders.create", "folders.update", "folders.delete", "files.list", "files.usage", "files.signedUrls", "files.upload", "files.get", "files.update", "files.delete", "files.content", "forms.list", "inquiries.list", "inquiries.get", "inquiries.moveStage", "customers.list", "customers.listTags", "customers.listFields", "customers.get", "customers.create", "customers.update", "customers.updateTags", "customers.listNotes", "customers.addNote", "customers.updateNote", "customers.deleteNote", "customers.timeline", "notifications.list", "notifications.unseenCount", "notifications.markAllSeen", "notifications.markSeen", "eav.listEntities", "eav.listRecords", "eav.createRecord", "eav.updateRecord", "eav.deleteRecord"];
|
|
38
38
|
type ConnectOperation = (typeof CONNECT_OPERATION_NAMES)[number];
|
|
39
39
|
type ConnectOperationRule = {
|
|
40
40
|
/** 서버 라우트(정책 표의 키) */
|
|
@@ -61,4 +61,4 @@ declare function canCall(me: {
|
|
|
61
61
|
} | readonly string[] | null | undefined, operation: ConnectOperation): boolean;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { ConnectOperationRule as a, WorkspacePermissionKey as c, canAny as d, canCall as f, ConnectOperation as i, can as l, CONNECT_OPERATION_NAMES as n, ConnectScope as o, CONNECT_SCOPES as r, WORKSPACE_PERMISSION_KEYS as s, CONNECT_OPERATIONS as t, canAll as u };
|
|
64
|
-
//# sourceMappingURL=permissions-
|
|
64
|
+
//# sourceMappingURL=permissions-DKm_zC_X.d.ts.map
|
package/dist/permissions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ConnectOperationRule, c as WorkspacePermissionKey, d as canAny, f as canCall, i as ConnectOperation, l as can, n as CONNECT_OPERATION_NAMES, o as ConnectScope, r as CONNECT_SCOPES, s as WORKSPACE_PERMISSION_KEYS, t as CONNECT_OPERATIONS, u as canAll } from "./permissions-
|
|
1
|
+
import { a as ConnectOperationRule, c as WorkspacePermissionKey, d as canAny, f as canCall, i as ConnectOperation, l as can, n as CONNECT_OPERATION_NAMES, o as ConnectScope, r as CONNECT_SCOPES, s as WORKSPACE_PERMISSION_KEYS, t as CONNECT_OPERATIONS, u as canAll } from "./permissions-DKm_zC_X.js";
|
|
2
2
|
export { CONNECT_OPERATIONS, CONNECT_OPERATION_NAMES, CONNECT_SCOPES, ConnectOperation, ConnectOperationRule, ConnectScope, WORKSPACE_PERMISSION_KEYS, WorkspacePermissionKey, can, canAll, canAny, canCall };
|
package/dist/permissions.js
CHANGED
|
@@ -167,6 +167,10 @@ const CONNECT_OPERATION_NAMES = [
|
|
|
167
167
|
"customers.updateNote",
|
|
168
168
|
"customers.deleteNote",
|
|
169
169
|
"customers.timeline",
|
|
170
|
+
"notifications.list",
|
|
171
|
+
"notifications.unseenCount",
|
|
172
|
+
"notifications.markAllSeen",
|
|
173
|
+
"notifications.markSeen",
|
|
170
174
|
"eav.listEntities",
|
|
171
175
|
"eav.listRecords",
|
|
172
176
|
"eav.createRecord",
|
|
@@ -409,6 +413,26 @@ const CONNECT_OPERATIONS = {
|
|
|
409
413
|
"customers.updateNote": customerWrite("PATCH /customer-notes/:noteId"),
|
|
410
414
|
"customers.deleteNote": customerWrite("DELETE /customer-notes/:noteId"),
|
|
411
415
|
"customers.timeline": customerRead("GET /customers/:id/timeline"),
|
|
416
|
+
"notifications.list": {
|
|
417
|
+
route: "GET /notifications",
|
|
418
|
+
permission: null,
|
|
419
|
+
scopes: READ
|
|
420
|
+
},
|
|
421
|
+
"notifications.unseenCount": {
|
|
422
|
+
route: "GET /notifications/unseen-count",
|
|
423
|
+
permission: null,
|
|
424
|
+
scopes: READ
|
|
425
|
+
},
|
|
426
|
+
"notifications.markAllSeen": {
|
|
427
|
+
route: "POST /notifications/seen",
|
|
428
|
+
permission: null,
|
|
429
|
+
scopes: READ
|
|
430
|
+
},
|
|
431
|
+
"notifications.markSeen": {
|
|
432
|
+
route: "POST /notifications/:id/seen",
|
|
433
|
+
permission: null,
|
|
434
|
+
scopes: READ
|
|
435
|
+
},
|
|
412
436
|
"eav.listEntities": {
|
|
413
437
|
route: "GET /eav/entities",
|
|
414
438
|
permission: "eav:read",
|
package/dist/social/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as PlatformApiError } from "../errors-
|
|
1
|
+
import { n as PlatformApiError } from "../errors-DKMC4kId.js";
|
|
2
2
|
import { REOPT_PLATFORM_ID_URLS, REOPT_PLATFORM_URLS, resolvePlatformUrls } from "../urls.js";
|
|
3
|
-
import { r as createPlatformRequester } from "../client-
|
|
3
|
+
import { r as createPlatformRequester } from "../client-BX4VHJS6.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/social/schemas.ts
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as WorkspacePermissionKey } from "../permissions-
|
|
2
|
-
import {
|
|
1
|
+
import { c as WorkspacePermissionKey } from "../permissions-DKm_zC_X.js";
|
|
2
|
+
import { $ as ConnectStageColor, G as ConnectPostSpec, N as ConnectMemberRole, et as ConnectStageOutcome, lt as ConnectTaskPriority, n as ConnectAnswerValue } from "../connect-CTxppAjD.js";
|
|
3
3
|
//#region src/testing/index.d.ts
|
|
4
4
|
/** 서로는 id가 아니라 `key`로 가리킨다 — id는 에뮬레이터가 만든다(`platform.id("task", key)`로 읽는다). */
|
|
5
5
|
type DevPlatformSeed = {
|
|
@@ -107,6 +107,25 @@ type DevPlatformSeed = {
|
|
|
107
107
|
submittedAt?: string;
|
|
108
108
|
memo?: string;
|
|
109
109
|
}>;
|
|
110
|
+
/**
|
|
111
|
+
* 로그인한 직원이 받은 알림. 에뮬레이터는 알림을 스스로 만들지 않는다 — 실제 리옵트는 **다른 사람**이 한 일을 알리는데
|
|
112
|
+
* 에뮬레이터에는 사람이 하나뿐이다. 벨 화면은 시드로 채운다.
|
|
113
|
+
*/
|
|
114
|
+
notifications?: Array<{
|
|
115
|
+
key?: string;
|
|
116
|
+
/** `task_assigned`·`task_comment`·`task_mention`·`task_stage_changed`·`task_due_soon`·`form_submitted`·`customer_created` */
|
|
117
|
+
kind: string;
|
|
118
|
+
subject?: string;
|
|
119
|
+
content: string;
|
|
120
|
+
/** 이미 읽은 알림 */
|
|
121
|
+
seen?: boolean;
|
|
122
|
+
actorName?: string;
|
|
123
|
+
/** 가리키는 업무의 key */
|
|
124
|
+
task?: string;
|
|
125
|
+
/** 가리키는 폼의 key */
|
|
126
|
+
form?: string;
|
|
127
|
+
createdAt?: string;
|
|
128
|
+
}>;
|
|
110
129
|
customers?: Array<{
|
|
111
130
|
key: string;
|
|
112
131
|
name: string;
|
|
@@ -205,7 +224,7 @@ type DevPlatform = {
|
|
|
205
224
|
/** 받은 요청 기록(최근 1,000건) — `"GET /files?folderId=all"` */
|
|
206
225
|
requests: string[];
|
|
207
226
|
};
|
|
208
|
-
type DevIdKind = "member" | "brand" | "pipeline" | "stage" | "task" | "postGroup" | "post" | "folder" | "file" | "form" | "submission" | "customer" | "table";
|
|
227
|
+
type DevIdKind = "member" | "brand" | "pipeline" | "stage" | "task" | "postGroup" | "post" | "folder" | "file" | "form" | "submission" | "customer" | "notification" | "table";
|
|
209
228
|
declare function createDevPlatform(options?: DevPlatformOptions): DevPlatform;
|
|
210
229
|
//#endregion
|
|
211
230
|
export { DevFormField, DevIdKind, DevPlatform, DevPlatformOptions, DevPlatformSeed, createDevPlatform };
|
package/dist/testing/index.js
CHANGED
|
@@ -511,6 +511,23 @@ function build(options) {
|
|
|
511
511
|
return `${browserBase}/v1/signed/files/${token}`;
|
|
512
512
|
};
|
|
513
513
|
const findCustomer = (id) => state.customers.find((c) => c.id === id) ?? notFound("Customer");
|
|
514
|
+
/** 알림 종류 → 그 알림이 가리키는 자료를 읽는 데 필요한 권한(+scope). 실제 서버의 표와 같다 */
|
|
515
|
+
const NOTIFICATION_ACCESS = {
|
|
516
|
+
task_assigned: { permission: "works:read" },
|
|
517
|
+
task_comment: { permission: "works:read" },
|
|
518
|
+
task_mention: { permission: "works:read" },
|
|
519
|
+
task_stage_changed: { permission: "works:read" },
|
|
520
|
+
task_due_soon: { permission: "works:read" },
|
|
521
|
+
form_submitted: { permission: "form:read" },
|
|
522
|
+
customer_created: {
|
|
523
|
+
permission: "customer:read",
|
|
524
|
+
scope: "customer:read"
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
const visibleNotifications = () => state.notifications.filter((row) => {
|
|
528
|
+
const access = NOTIFICATION_ACCESS[row.kind];
|
|
529
|
+
return access !== void 0 && permissions.has(access.permission) && (!access.scope || scopes.includes(access.scope));
|
|
530
|
+
}).sort((a, b) => b.createdAt.localeCompare(a.createdAt) || b.id.localeCompare(a.id));
|
|
514
531
|
const customerSummary = (row) => ({
|
|
515
532
|
id: row.id,
|
|
516
533
|
name: row.name,
|
|
@@ -1356,6 +1373,50 @@ function build(options) {
|
|
|
1356
1373
|
});
|
|
1357
1374
|
}
|
|
1358
1375
|
],
|
|
1376
|
+
[
|
|
1377
|
+
"GET",
|
|
1378
|
+
/^\/notifications$/,
|
|
1379
|
+
"notifications.list",
|
|
1380
|
+
({ url }) => {
|
|
1381
|
+
const window = windowOf(url, 50);
|
|
1382
|
+
const unseen = url.searchParams.get("unseen");
|
|
1383
|
+
if (unseen !== null && unseen !== "true" && unseen !== "false") invalid("unseen", "Expected true or false");
|
|
1384
|
+
return paged(visibleNotifications().filter((row) => unseen !== "true" || row.seenAt === null), {
|
|
1385
|
+
limit: window.limit ?? 20,
|
|
1386
|
+
offset: window.offset
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
],
|
|
1390
|
+
[
|
|
1391
|
+
"GET",
|
|
1392
|
+
/^\/notifications\/unseen-count$/,
|
|
1393
|
+
"notifications.unseenCount",
|
|
1394
|
+
() => ok({ count: Math.min(visibleNotifications().filter((row) => row.seenAt === null).length, 100) })
|
|
1395
|
+
],
|
|
1396
|
+
[
|
|
1397
|
+
"POST",
|
|
1398
|
+
/^\/notifications\/seen$/,
|
|
1399
|
+
"notifications.markAllSeen",
|
|
1400
|
+
() => {
|
|
1401
|
+
const unseen = visibleNotifications().filter((row) => row.seenAt === null);
|
|
1402
|
+
const at = stamp();
|
|
1403
|
+
for (const row of unseen) row.seenAt = at;
|
|
1404
|
+
return ok({ count: unseen.length });
|
|
1405
|
+
}
|
|
1406
|
+
],
|
|
1407
|
+
[
|
|
1408
|
+
"POST",
|
|
1409
|
+
new RegExp(`^/notifications/${UUID}/seen$`),
|
|
1410
|
+
"notifications.markSeen",
|
|
1411
|
+
({ params }) => {
|
|
1412
|
+
const row = visibleNotifications().find((item) => item.id === params[0]) ?? notFound("Notification");
|
|
1413
|
+
row.seenAt ??= stamp();
|
|
1414
|
+
return ok({
|
|
1415
|
+
id: row.id,
|
|
1416
|
+
seenAt: row.seenAt
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
],
|
|
1359
1420
|
[
|
|
1360
1421
|
"GET",
|
|
1361
1422
|
/^\/customers$/,
|
|
@@ -1870,15 +1931,23 @@ function build(options) {
|
|
|
1870
1931
|
const formDefinition = (form) => ({
|
|
1871
1932
|
formId: form.id,
|
|
1872
1933
|
name: form.name,
|
|
1873
|
-
fields: form.fields.map((field) =>
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1934
|
+
fields: form.fields.map((field) => {
|
|
1935
|
+
const kind = field.type ?? "text";
|
|
1936
|
+
return {
|
|
1937
|
+
name: field.name,
|
|
1938
|
+
label: field.label,
|
|
1939
|
+
type: kind === "text" || kind === "tel" ? "string" : kind === "checkbox" ? "boolean" : kind,
|
|
1940
|
+
required: field.required ?? false,
|
|
1941
|
+
placeholder: null,
|
|
1942
|
+
description: null,
|
|
1943
|
+
options: field.options?.map((option) => typeof option === "string" ? {
|
|
1944
|
+
value: option,
|
|
1945
|
+
label: option
|
|
1946
|
+
} : option) ?? null,
|
|
1947
|
+
inputPurpose: kind === "email" ? "email" : kind === "tel" ? "tel" : field.name === "name" ? "name" : null,
|
|
1948
|
+
appearance: kind === "tel" ? "phone" : "default"
|
|
1949
|
+
};
|
|
1950
|
+
}),
|
|
1882
1951
|
submitLabel: form.submitLabel,
|
|
1883
1952
|
successMessage: form.successMessage,
|
|
1884
1953
|
consent: form.consentLabel ? [{
|
|
@@ -1887,7 +1956,7 @@ function build(options) {
|
|
|
1887
1956
|
required: true,
|
|
1888
1957
|
linkUrl: null,
|
|
1889
1958
|
termsId: null
|
|
1890
|
-
}] :
|
|
1959
|
+
}] : null
|
|
1891
1960
|
});
|
|
1892
1961
|
const submitForm = (form, body) => {
|
|
1893
1962
|
const input = body;
|
|
@@ -1901,8 +1970,8 @@ function build(options) {
|
|
|
1901
1970
|
status: 422,
|
|
1902
1971
|
body: { error: {
|
|
1903
1972
|
code: "CONSENT_REQUIRED",
|
|
1904
|
-
message: "필수
|
|
1905
|
-
|
|
1973
|
+
message: "필수 동의 항목에 동의해주세요.",
|
|
1974
|
+
fieldErrors: { consent: "필수 동의 항목입니다." }
|
|
1906
1975
|
} }
|
|
1907
1976
|
};
|
|
1908
1977
|
const answers = {};
|
|
@@ -1910,7 +1979,7 @@ function build(options) {
|
|
|
1910
1979
|
for (const field of form.fields) {
|
|
1911
1980
|
const value = input.values[field.name];
|
|
1912
1981
|
if (value === void 0 || value === null || value === "" || value === false) {
|
|
1913
|
-
if (field.required) errors[field.name] =
|
|
1982
|
+
if (field.required) errors[field.name] = "필수 항목입니다.";
|
|
1914
1983
|
continue;
|
|
1915
1984
|
}
|
|
1916
1985
|
if (field.type === "email" && !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(String(value))) {
|
|
@@ -1927,8 +1996,8 @@ function build(options) {
|
|
|
1927
1996
|
status: 422,
|
|
1928
1997
|
body: { error: {
|
|
1929
1998
|
code: "VALIDATION_ERROR",
|
|
1930
|
-
message: "
|
|
1931
|
-
|
|
1999
|
+
message: "입력값을 확인해주세요.",
|
|
2000
|
+
fieldErrors: errors
|
|
1932
2001
|
} }
|
|
1933
2002
|
};
|
|
1934
2003
|
const submission = addSubmission(form, answers, void 0, void 0);
|
|
@@ -2108,6 +2177,7 @@ function seedState(options) {
|
|
|
2108
2177
|
submissions: [],
|
|
2109
2178
|
customers: [],
|
|
2110
2179
|
customerFields: [],
|
|
2180
|
+
notifications: [],
|
|
2111
2181
|
tables: [],
|
|
2112
2182
|
ids: /* @__PURE__ */ new Map(),
|
|
2113
2183
|
counter: 0,
|
|
@@ -2311,6 +2381,26 @@ function seedState(options) {
|
|
|
2311
2381
|
updatedAt: at
|
|
2312
2382
|
});
|
|
2313
2383
|
}
|
|
2384
|
+
for (const item of seed.notifications ?? []) {
|
|
2385
|
+
const at = item.createdAt ? new Date(item.createdAt).toISOString() : stamp();
|
|
2386
|
+
state.notifications.push({
|
|
2387
|
+
id: newId("notification", item.key),
|
|
2388
|
+
kind: item.kind,
|
|
2389
|
+
subject: item.subject ?? null,
|
|
2390
|
+
content: item.content,
|
|
2391
|
+
seenAt: item.seen ? at : null,
|
|
2392
|
+
createdAt: at,
|
|
2393
|
+
actorName: item.actorName ?? null,
|
|
2394
|
+
actorImage: null,
|
|
2395
|
+
entity: item.task ? {
|
|
2396
|
+
type: "task",
|
|
2397
|
+
id: ref("task", item.task, "a notification")
|
|
2398
|
+
} : item.form ? {
|
|
2399
|
+
type: "form",
|
|
2400
|
+
id: ref("form", item.form, "a notification")
|
|
2401
|
+
} : null
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2314
2404
|
for (const table of seed.tables ?? []) {
|
|
2315
2405
|
const row = {
|
|
2316
2406
|
id: newId("table", table.key),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as SDK_VERSION, n as PlatformApiError } from "./errors-
|
|
1
|
+
import { l as SDK_VERSION, n as PlatformApiError } from "./errors-DKMC4kId.js";
|
|
2
2
|
|
|
3
3
|
//#region src/workspace/transport.ts
|
|
4
4
|
function parseRetryAfter(value) {
|
|
@@ -189,4 +189,4 @@ function createTransport(config) {
|
|
|
189
189
|
|
|
190
190
|
//#endregion
|
|
191
191
|
export { readPlatformFailure as n, createTransport as t };
|
|
192
|
-
//# sourceMappingURL=transport-
|
|
192
|
+
//# sourceMappingURL=transport-BEwY_twi.js.map
|
package/docs/forms.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Public forms (`@reopt-ai/workspace-sdk/forms`)
|
|
2
|
+
|
|
3
|
+
A visitor's browser reads a published Reopt form and submits to it **directly**. No dependencies,
|
|
4
|
+
no credentials — a form id is not a secret, and only published forms answer.
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
import {
|
|
8
|
+
createPublicFormClient,
|
|
9
|
+
isPublicFormError,
|
|
10
|
+
} from "@reopt-ai/workspace-sdk/forms";
|
|
11
|
+
|
|
12
|
+
const forms = createPublicFormClient(); // https://studio.reopt.ai
|
|
13
|
+
|
|
14
|
+
const form = await forms.get(formId); // fields, consent items, button label
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const { successMessage } = await forms.submit(formId, {
|
|
18
|
+
values: { name, email, topic, message }, // keyed by field.name
|
|
19
|
+
consents: { [consentItem.id]: true },
|
|
20
|
+
meta: { hp: honeypotValue, pagePath: location.pathname },
|
|
21
|
+
});
|
|
22
|
+
showDone(successMessage ?? form.successMessage);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (!isPublicFormError(error)) throw error;
|
|
25
|
+
showFieldErrors(error.fieldErrors); // { email: "…", [consentItem.id]: "…" }
|
|
26
|
+
if (Object.keys(error.fieldErrors).length === 0) showBanner(error.message);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Do not relay through your server
|
|
31
|
+
|
|
32
|
+
Reopt limits submissions **per visitor IP** (5 a minute, 50 an hour). If your server posts on the
|
|
33
|
+
visitor's behalf, every visitor shares your server's address and its limit. Reopt allows
|
|
34
|
+
cross-origin requests on these routes and accepts no cookies (the client sends `credentials:
|
|
35
|
+
"omit"`). Add the Studio origin to your CSP `connect-src`.
|
|
36
|
+
|
|
37
|
+
In dev mode point the client at the emulator instead — `studioUrl` is the `browserBaseUrl` you
|
|
38
|
+
gave `createDevPlatform` (see [testing.md](./testing.md)). The emulator does not rate-limit.
|
|
39
|
+
|
|
40
|
+
## The definition
|
|
41
|
+
|
|
42
|
+
`forms.get(formId)` returns the published form.
|
|
43
|
+
|
|
44
|
+
| Field | Meaning |
|
|
45
|
+
| ----------------------- | -------------------------------------------------------------------------------------------- |
|
|
46
|
+
| `fields[]` | `name` (the key in `values`), `label`, `type`, `required`, `options`, `placeholder` |
|
|
47
|
+
| `fields[].type` | `string` `textarea` `email` `url` `number` `boolean` `date` `select` `multiselect` `file` |
|
|
48
|
+
| `fields[].options` | `{ value, label }[]` for select types — submit the `value` |
|
|
49
|
+
| `fields[].inputPurpose` | `name` / `email` / `tel` — use it for `autocomplete`; `appearance: "phone"` for phone inputs |
|
|
50
|
+
| `consent[]` | `id` (the key in `consents`), `label`, `required`, `linkUrl` — empty when there are none |
|
|
51
|
+
| `submitLabel` | Button text, or null |
|
|
52
|
+
| `successMessage` | Text to show after submitting, or null |
|
|
53
|
+
|
|
54
|
+
Everything else Reopt's own renderer uses (theme, page breaks, booking slots) is passed through
|
|
55
|
+
untyped. Render from `fields` and a form edited in Studio keeps working without a deploy; a
|
|
56
|
+
field you hard-code stops matching the day someone renames it.
|
|
57
|
+
|
|
58
|
+
## Submitting
|
|
59
|
+
|
|
60
|
+
- An empty answer (`""`, `null`, missing) means "not answered".
|
|
61
|
+
- **Honeypot**: render an input people cannot see and pass its value as `meta.hp`. If it is
|
|
62
|
+
filled Reopt answers as if it succeeded and stores nothing (`submissionId: null`) — show your
|
|
63
|
+
normal done screen.
|
|
64
|
+
- The same answers sent again within two minutes return the first result instead of creating a
|
|
65
|
+
second submission, as long as the submission names someone (a name, email or phone). An
|
|
66
|
+
anonymous form can store a retry twice.
|
|
67
|
+
- `file` fields need Reopt's upload route first; this client does not cover it yet.
|
|
68
|
+
|
|
69
|
+
## Errors
|
|
70
|
+
|
|
71
|
+
Everything the client throws is a `PublicFormError` (except the caller's own abort).
|
|
72
|
+
|
|
73
|
+
| `code` | When | `retryable` |
|
|
74
|
+
| ------------------------- | ------------------------------------------------------------------------------- | ----------- |
|
|
75
|
+
| `VALIDATION_ERROR` | A required field is empty or a value is invalid — `fieldErrors` by field `name` | no |
|
|
76
|
+
| `CONSENT_REQUIRED` | A required consent is missing — `fieldErrors` by consent `id` | no |
|
|
77
|
+
| `FORM_NOT_FOUND` | No such form, or it is not published | no |
|
|
78
|
+
| `RATE_LIMITED` | Too many submissions from this visitor | yes |
|
|
79
|
+
| `SUBMISSION_IN_PROGRESS` | The same submission is still being processed | yes |
|
|
80
|
+
| `PAYLOAD_TOO_LARGE` | The body is over the limit | no |
|
|
81
|
+
| `NETWORK_ERROR` `TIMEOUT` | No answer (client-made, `status: 0`) | yes |
|
|
82
|
+
| `INVALID_RESPONSE` | An answer in an unexpected shape | on 5xx |
|
|
83
|
+
|
|
84
|
+
`error.message` is Reopt's own Korean sentence for the first six and safe to show a visitor.
|
|
85
|
+
|
|
86
|
+
## Labelling answers in an admin screen
|
|
87
|
+
|
|
88
|
+
Inquiries (`createConnectClient().inquiries`) carry `answers` keyed by field `name`. Label them
|
|
89
|
+
from the form instead of repeating the field list in your code:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { labelAnswers } from "@reopt-ai/workspace-sdk/forms";
|
|
93
|
+
|
|
94
|
+
const form = await forms.get(inquiry.formId);
|
|
95
|
+
labelAnswers(form.fields, inquiry.answers);
|
|
96
|
+
// [{ name: "topic", label: "문의 유형", value: "service", text: "서비스 도입" }, …]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Rows follow the form's field order; answers to fields that were later removed come after them
|
|
100
|
+
under their `name`; empty answers are left out.
|
package/docs/testing.md
CHANGED
|
@@ -42,12 +42,12 @@ export const OPTIONS = GET;
|
|
|
42
42
|
|
|
43
43
|
## What it answers
|
|
44
44
|
|
|
45
|
-
| Surface | Through | Notes
|
|
46
|
-
| ---------------------------------------------- | --------- |
|
|
47
|
-
| `/v1/connect/*` — every `ConnectClient` method | `fetch` | Tasks, posts, folders, files, forms, inquiries, customers, brands, members, app tables
|
|
48
|
-
| Machine: token, `/v1/me`, `/v1/posts` | `fetch` | Published posts only. The client assertion is not checked
|
|
49
|
-
| Signed file addresses, public file bytes | `handler` | `…/v1/signed/files/:token`, `…/api/blob/:id`
|
|
50
|
-
| Public form: definition and submit | `handler` | `…/api/brandfront/forms/:id` and `/submit` (CORS, 422
|
|
45
|
+
| Surface | Through | Notes |
|
|
46
|
+
| ---------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
47
|
+
| `/v1/connect/*` — every `ConnectClient` method | `fetch` | Tasks, posts, folders, files, forms, inquiries, customers, notifications, brands, members, app tables |
|
|
48
|
+
| Machine: token, `/v1/me`, `/v1/posts` | `fetch` | Published posts only. The client assertion is not checked |
|
|
49
|
+
| Signed file addresses, public file bytes | `handler` | `…/v1/signed/files/:token`, `…/api/blob/:id` |
|
|
50
|
+
| Public form: definition and submit | `handler` | `…/api/brandfront/forms/:id` and `/submit` (CORS, 422 `fieldErrors`) — use `createPublicFormClient({ studioUrl })` |
|
|
51
51
|
|
|
52
52
|
Anything else answers 501 `NOT_IMPLEMENTED`, so a missing route shows up as an error, not as data.
|
|
53
53
|
|
|
@@ -56,6 +56,10 @@ writes, `VERSION_CONFLICT`, `SLUG_TAKEN`, `VALIDATION_ERROR` with `fields`, 413
|
|
|
56
56
|
`QUOTA_EXCEEDED`, refused changes to system folders, 409 for a non-empty folder, and files that a
|
|
57
57
|
published post references becoming public.
|
|
58
58
|
|
|
59
|
+
Notifications come from the seed only (`seed.notifications: [{ kind, content, task?, form?, seen? }]`)
|
|
60
|
+
— the real Reopt notifies people about what **others** did, and the emulator has one person. Which
|
|
61
|
+
kinds show follows the same rule as the server (`me.permissions` and `me.scopes`).
|
|
62
|
+
|
|
59
63
|
**It does not imitate** authentication (tokens are not checked), per-folder access, rate limits,
|
|
60
64
|
webhook delivery or workflows. It refuses to start when `NODE_ENV` is `production`.
|
|
61
65
|
|
package/docs/workspace.md
CHANGED
|
@@ -518,6 +518,37 @@ needs write access to the folder it is in **and** the folder it moves to.
|
|
|
518
518
|
| `accessToken` had to return a string | May return `null` (→ 401 `UNAUTHORIZED`, nothing is sent) |
|
|
519
519
|
| Node 18 | Node 20+ |
|
|
520
520
|
|
|
521
|
+
### Notifications
|
|
522
|
+
|
|
523
|
+
Staff who work in your app never open Studio, so the assignments, mentions and comments Reopt
|
|
524
|
+
notifies them about would go unseen. `notifications` reads the signed-in member's own Reopt
|
|
525
|
+
notifications and marks them seen.
|
|
526
|
+
|
|
527
|
+
```ts
|
|
528
|
+
const count = await reopt.notifications.unseenCount(); // the bell — stops at 100 ("99+")
|
|
529
|
+
const { items, nextOffset } = await reopt.notifications.list({ unseen: true });
|
|
530
|
+
|
|
531
|
+
for (const n of items) {
|
|
532
|
+
// n.kind, n.subject, n.content (Reopt's own sentence), n.actorName, n.createdAt, n.seenAt
|
|
533
|
+
if (n.entity?.type === "task") openTask(n.entity.id); // → reopt.works.getTask(id)
|
|
534
|
+
if (n.entity?.type === "form") openInquiries(n.entity.id);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
await reopt.notifications.markSeen(items[0].id);
|
|
538
|
+
await reopt.notifications.markAllSeen(); // → { count }
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
- **Only what this connection may read arrives.** Task kinds (`task_assigned`, `task_comment`,
|
|
542
|
+
`task_mention`, `task_stage_changed`, `task_due_soon`) need the member's `works:read`;
|
|
543
|
+
`form_submitted` needs `form:read`; `customer_created` (it names the customer) needs
|
|
544
|
+
`customer:read` — both the role and the scope. Reopt's other notifications (billing, security,
|
|
545
|
+
membership) never come through here, and `markAllSeen` does not touch them.
|
|
546
|
+
- Seen state is shared with Studio: read here, read there.
|
|
547
|
+
- `entity` is null for digests ("3 new customers today").
|
|
548
|
+
- Marking seen needs only a read scope — it changes the member's own state, not workspace data —
|
|
549
|
+
and is not recorded in the connection's write history.
|
|
550
|
+
- Reopt has no push channel to your app for these. Poll `unseenCount()` (once a minute is plenty).
|
|
551
|
+
|
|
521
552
|
### The app's own tables
|
|
522
553
|
|
|
523
554
|
Data that has no Reopt domain (not a task, post, file or inquiry) can live in tables the
|