@wildo-ai/saas-specifications 1.1.13 → 1.1.15
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/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +28 -5
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js +4 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +4 -0
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js +10 -0
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
- package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.js +21 -0
- package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +1 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +1 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +5 -3
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +2 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js +6 -2
- package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.js +6 -5
- package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +22 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +2 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.js +136 -0
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +4 -2
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +6 -5
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.js +2 -1
- package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +10 -7
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +1 -0
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +7 -7
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/index.d.ts +3 -1
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -2
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +2 -2
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"m2m-webhook-delivery-log.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,yCAAyC,GAC1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAoC,MAAM,6BAA6B,CAAC;AAC9H,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAU3E,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AAE;YACnB,sQAAsQ;YACtQ,gJAAgJ;YAChJ,qKAAqK;SACtK;KACF,CAAC,EACF,EAAE,oBAAoB,EAAE,kCAAkC,CAAC,YAAY,CAAC,EAAE,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sDAAsD,GAAG,uCAAuC,CAC3G,gBAAgB,CAAC,qCAAqC,EACtD,uCAAuC,CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,qDAAqD,GAAG,uCAAuC,CAC1G,gBAAgB,CAAC,oCAAoC,EACrD,sCAAsC,CACvC,CAAC","sourcesContent":["/**\n * Resources: `organizationM2mWebhookDeliveryLog` + `applicationM2mWebhookDeliveryLog` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic ORG + APP pair sharing `M2MWebhookDeliveryLogBaseSchema` and `m2mWebhookDeliveryLogPolymorphicFactories`.\n *\n * Inputs:\n * - Base schema: `M2MWebhookDeliveryLogBaseSchema` (`m2m-webhook-delivery-log.shared.schemas.ts`)\n * - Polymorphic factories: `m2mWebhookDeliveryLogPolymorphicFactories` (`m2m-webhook-delivery-log.shared.resources-config.schemas.ts`)\n * - Custom operations: `M2MWebhookDeliveryLog_Operations` (`retry`, `purgeOld`)\n * - UI presets: `webhooksMainPresets` / `webhooksAdminPresets`\n * (engine/presets-components/src/config/resources/webhooks.resource-presets.tsx) —\n * a section-less layout surfaced in the org Settings Hub `webhooks` section\n * (Delivery log sub-tab), dashboard-style via generic collection capabilities:\n * status quick-filter tab strip (`collectionDisplayConfig.quickFilterField`)\n * + day-bucket date headings (`temporalGroupField: 'createdAt'`) on LIST,\n * EMBEDDED READ (row click → companion drawer): the resource · operation as the\n * title and the status badge on the facts line under it, then one flat list of facts with empty\n * rows hidden, and the opaque `payload` last, unlabelled, as pretty JSON.\n * Cards show the status, URL, labelled attempt count and failure reason.\n * `retry` / `purgeOld` actions.\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreM2MNotificationChannel,\n CoreResourceOperation as Op,\n CoreResourceType,\n M2MWebhookDeliveryLog_Operations,\n M2MWebhookDeliveryLogBaseSchema,\n M2MWebhookDeliveryLogStatus,\n M2MWebhookEventType,\n ResourcePrimaryScope,\n m2mWebhookDeliveryLogPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification, type ResourceSpecificationConfig } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype M2mDeliveryLogResourceType =\n | CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG\n | CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG;\n\ntype M2mDeliveryLogResourceTypeMember =\n | 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG'\n | 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG';\n\nconst m2mDeliveryLogResourcePrimaryScope: Record<M2mDeliveryLogResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype M2mDeliveryFactoryCfg = ReturnType<\n (typeof m2mWebhookDeliveryLogPolymorphicFactories)[CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]\n>;\ntype M2mDeliveryCustomOp = NonNullable<M2mDeliveryFactoryCfg['customOperation']>;\ntype M2mDeliveryCoreOp =\n | Op.READ\n | Op.LIST\n | Op.SEARCH\n | Op.CREATE\n | Op.UPDATE\n | Op.DELETE\n | Op.DELETE_MANY;\ntype M2mDeliveryMain = typeof M2MWebhookDeliveryLogBaseSchema;\n\nfunction buildM2mWebhookDeliveryLogSpecification(\n resourceType: M2mDeliveryLogResourceType,\n memberName: M2mDeliveryLogResourceTypeMember,\n): ResourceSpecificationConfig<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain> {\n const isOrganizationScope = resourceType === CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG;\n const scopeIdentity = isOrganizationScope\n ? { organizationId: 'org_01JEXAMPLE' }\n : { applicationId: 'app_01JEXAMPLE' };\n const channel = isOrganizationScope\n ? CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION\n : CoreM2MNotificationChannel.WEBHOOK_APPLICATION;\n const deliveryIdentity = {\n _id: 'delivery_01JEXAMPLE',\n endpointId: 'orders-primary',\n channel,\n resourceIdentifier: 'orders',\n operationIdentifier: 'create',\n httpUrl: 'https://partners.example.com/webhooks/orders',\n payloadHash: '31da863f127a6c22b91b5cc85081c382b02039a9c8c4b30db2cc3172de31d2d8',\n payload: { event: 'order.created', orderId: 'order_01JEXAMPLE' },\n signatureJti: 'webhook-signature-01JEXAMPLE',\n createdAt: '2026-08-18T09:30:00.000Z',\n updatedAt: '2026-08-18T09:32:12.000Z',\n ...scopeIdentity,\n } as const;\n const failedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.FAILED,\n attemptCount: 5,\n lastAttemptAt: '2026-08-18T09:32:12.000Z',\n responseStatus: 503,\n responseBodyTruncated: 'Service temporarily unavailable',\n failureReason: 'The receiver returned HTTP 503 after the final retry.',\n failedAt: '2026-08-18T09:32:12.000Z',\n } as const;\n const retriedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.PENDING,\n attemptCount: 0,\n nextAttemptAt: '2026-08-18T09:35:00.000Z',\n } as const;\n const deliveryPageExample = {\n data: [failedDeliveryExample],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n } as const;\n\n return resourceSpecification<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain>(\n m2mWebhookDeliveryLogPolymorphicFactories[resourceType],\n M2MWebhookDeliveryLogBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Persist one record per outbound endpoint delivery (queue entry, attempt count, latest HTTP evidence, and signing metadata) for org- or app-scoped admin review and retry.',\n businessRole: 'The user-visible event log and the worker’s durable queue for asynchronous webhook delivery — one row per (scope × target endpoint × fire).',\n lifecycleRole: 'Rows move PENDING → IN_FLIGHT → DELIVERED, or PENDING/IN_FLIGHT → FAILED, with `attemptCount` and `nextAttemptAt` governing back-off; RETRY and PURGE_OLD custom ops re-queue or clean history.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.NOTIFICATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'm2mWebhookDeliveryLogPolymorphicFactories',\n symbolKind: CodeSymbolKind.FACTORY,\n },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName,\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLog_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'The polymorphism engine injects `organizationId` (ORG variant) or `applicationId` (APP variant) on the document — those FKs are not on the base Zod object.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Unique id for a single delivery log record and lease token anchor for the worker.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n endpointId: schemaShape.endpointId.stringSpec({\n meaning: 'Stable FK to `webhookConfig.endpoints[].id` at enqueue time so historical records survive endpoint renames/URL changes.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n channel: schemaShape.channel.enumSpec({\n meaning: 'Which M2M channel the originating operation fired (must be compatible with the resource’s primary scope in the dispatcher).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreM2MNotificationChannel',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION]: { meaning: 'Org-scoped outbound webhook (requires an org id in the execution context).' },\n [CoreM2MNotificationChannel.WEBHOOK_APPLICATION]: { meaning: 'App-scoped outbound webhook (resolves the app id from `appConfigService`).' },\n },\n }),\n eventType: schemaShape.eventType.enumSpec({\n meaning: 'What the delivery reports, sent as its event header so a receiver can route before parsing the body. A row written before events existed reported a completed operation, so that is its value.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookEventType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [M2MWebhookEventType.OPERATION_COMPLETED]: { meaning: 'The operation succeeded: inline, or as a background run.' },\n [M2MWebhookEventType.OPERATION_FAILED]: { meaning: 'A background run of the operation failed.' },\n },\n }),\n jobId: schemaShape.jobId.stringSpec({\n meaning: 'The background job the delivery reports on: present for every `operation.failed`, and for an `operation.completed` produced by a background run. Absent for an inline call, which has no job.',\n semanticRole: 'code',\n }),\n resourceIdentifier: schemaShape.resourceIdentifier.stringSpec({\n meaning: 'Originating `CoreResourceType` string (or app resource key) that produced the M2M payload.',\n semanticRole: 'code',\n }),\n operationIdentifier: schemaShape.operationIdentifier.stringSpec({\n meaning: 'Operation or custom-op identifier that the serializer used when building the POST body (used for support correlation).',\n semanticRole: 'code',\n }),\n variantKey: schemaShape.variantKey.stringSpec({\n meaning: 'Optional default vs named operation variant, when the originating op exposed multiple API variants.',\n }),\n httpUrl: schemaShape.httpUrl.stringSpec({\n meaning: 'Snapshot of the destination URL captured when this delivery was queued (duplicated from the config so URL edits do not rewrite history).',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'uri',\n }),\n payloadHash: schemaShape.payloadHash.stringSpec({\n meaning: 'SHA-256 of the JSON body, mirrored into the signed JWT and used to detect replays or tampering.',\n semanticRole: 'code',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Current queue/delivery state for the worker and admin filters.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n },\n values: {\n [M2MWebhookDeliveryLogStatus.PENDING]: { meaning: 'Record is either waiting in the queue or has been re-queued for another attempt after a transient failure.' },\n [M2MWebhookDeliveryLogStatus.IN_FLIGHT]: { meaning: 'A worker currently holds a lease and is trying to send the HTTP request.' },\n [M2MWebhookDeliveryLogStatus.DELIVERED]: { meaning: 'The consumer returned a 2xx acknowledgement; terminal delivery success. This does not establish whether the consumer verified the signature or completed downstream processing.' },\n [M2MWebhookDeliveryLogStatus.FAILED]: { meaning: 'Terminal failure: exhausted attempt budget or a non-retryable 4xx class error.' },\n },\n }),\n attemptCount: schemaShape.attemptCount.numberSpec({\n meaning: 'Number of send attempts (including successes that still increment the counter, per worker policy).',\n unit: 'count',\n }),\n lastAttemptAt: schemaShape.lastAttemptAt.dateSpec({\n meaning: 'When the most recent send attempt started or finished, depending on writer semantics.',\n temporalRole: 'occurred',\n }),\n nextAttemptAt: schemaShape.nextAttemptAt.dateSpec({\n meaning: 'When a PENDING delivery becomes eligible for retry; indexed with status for worker polling. Terminal rows can retain an earlier value, which does not schedule another attempt.',\n temporalRole: 'scheduled',\n }),\n responseStatus: schemaShape.responseStatus.numberSpec({\n meaning: 'Last observed HTTP status code (present even for successes for observability).',\n }),\n responseBodyTruncated: schemaShape.responseBodyTruncated.stringSpec({\n meaning: 'First 4 KB of the HTTP response (when captured) to help debug remote listener failures.',\n }),\n failureReason: schemaShape.failureReason.stringSpec({\n meaning: 'Human-readable last error string when `status=failed` (worker-set).',\n }),\n signatureJti: schemaShape.signatureJti.stringSpec({\n meaning: 'Stable delivery identity carried in the JWT `jti` claim inside `x-wildo-webhook-signature`. The receiver uses it to deduplicate retries; it is not a signing-key identifier.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n deliveredAt: schemaShape.deliveredAt.dateSpec({\n meaning: 'Timestamp when a terminal `delivered` state was recorded.',\n temporalRole: 'occurred',\n }),\n failedAt: schemaShape.failedAt.dateSpec({\n meaning: 'Timestamp when a terminal `failed` state was recorded.',\n temporalRole: 'occurred',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the record was enqueued (immutable upper bound for retention policies).',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When status / attempt counters / timestamps last changed for this id.',\n temporalRole: 'modified',\n }),\n },\n // `payload` is `z.unknown()`, which carries no spec decorators, so its meaning is declared\n // through the escape hatch rather than dropped.\n additionalFieldSpecs: [\n {\n fieldName: 'payload',\n specDecorator: 'objectSpec',\n params: {\n meaning: 'The exact JSON body that was sent, as text: the originating operation’s result as its API response returns it, without internal versioning metadata. `payloadHash` is the SHA-256 of this text.',\n whyItMatters: 'It carries whatever the resource row carried, routinely personal data, so treat it as sensitive.',\n },\n },\n ],\n operations: {\n [Op.READ]: {\n /*\n * `payload` is stored opaquely and is deliberately not broken into documented fields.\n * That is a storage decision the reader of this sentence does not need; what they DO\n * need is that it comes back whole and carries whatever the event carried.\n */\n purpose: 'Inspect one delivery attempt using the fields documented above (status, URL snapshot, hashes, HTTP evidence, correlation ids). The stored `payload` is returned whole rather than broken into documented fields — treat it as sensitive; see `businessConstraints`.',\n outcome: 'Operators can see whether a business event was delivered and, if not, the precise failure class.',\n whenToUse: 'Use when triaging a customer ticket referencing a `deliveryLogId` or `signatureJti`.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery log record for the supplied id was found and its status, URL snapshot, HTTP evidence, and signing metadata are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id in this scope (never enqueued, or already removed by `purgeOld`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role; because `payload` may embed serialized customer data, reads are gated to roles that already see that data (see `businessConstraints`).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect a failed order webhook delivery',\n response: failedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse recent delivery attempts in chronological order, filtered by the repository’s search defaults.',\n outcome: 'Admins can scan for spikes in `failed` rows or revalidation after URL rotation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) chronological page of delivery log records in this scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to browse the delivery log (rows may carry serialized customer payloads).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent delivery attempts',\n request: { page: 1, limit: 20, sort: 'createdAt:desc' },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Filter log rows on status, `endpointId`, channel, date windows, and operation identifiers to isolate incidents.',\n outcome: 'Security and ops can produce CSV-grade subsets without an external data warehouse in small deployments.',\n whenToUse: 'Use in admin dashboards; heavy analytics may still go to a warehouse — this is the operational “small query” path.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of delivery log records matching the status / endpoint / channel / date-window / operation filters.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to search the delivery log.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find failures for one endpoint',\n request: {\n q: 'orders',\n status: M2MWebhookDeliveryLogStatus.FAILED,\n channel,\n endpointId: 'orders-primary',\n page: 1,\n limit: 20,\n sort: 'createdAt:desc',\n },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Enqueue a new delivery row when a resource operation with an M2M channel fires.',\n outcome: 'The worker pool can find ready rows via the `(status, nextAttemptAt)` index.',\n whenToUse: 'Repository-only: invoked by the dispatcher, never by a human HTTP client.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A `pending` delivery record was enqueued and is now discoverable by the worker pool. Internal/service write path — the dispatcher fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The enqueue payload fails schema validation (e.g. missing `endpointId`, `httpUrl`, or `channel`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to enqueue a delivery row directly.' },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Drive the delivery lifecycle status transitions (PENDING → IN_FLIGHT → DELIVERED/FAILED) with `attemptCount` / `nextAttemptAt` / terminal-timestamp writes.',\n outcome: 'The worker can advance a row through its lifecycle so the `(status, nextAttemptAt)` index stays accurate for polling and back-off.',\n whenToUse: 'Repository-only: invoked by the dispatcher/worker (`markInFlight` / `markDelivered` / `markFailedAttempt` / `markFinallyFailed`), never by a human HTTP client — admins act via the `RETRY` custom operation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery record’s status / attempt counters / timestamps were updated. Internal/service write path — the worker fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to update.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to mutate a delivery row directly; UI flows must use the `RETRY` custom operation.' },\n ],\n idempotent: false,\n },\n [Op.DELETE]: {\n purpose: 'Reserved for `purgeOld` and internal cleanup — no public single-row delete to keep the audit trail honest.',\n outcome: 'Old rows are removed in bulk, not opportunistically per UI click, matching the high-risk gating in the config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'An internal/maintenance single-record delete completed; the body carries its `id`. Intentionally not a public per-click operation — routine cleanup goes through `purgeOld`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to delete.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an operator authorized for exceptional single-row maintenance deletes; UI flows must use `purgeOld` instead.' },\n ],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'The bulk delete behind `purgeOld`, and the retention-class sweep\\'s door through its route-less INTERNAL_CALL variant: `purgeOld` removes terminal rows older than the requested window, and the sweep removes any row untouched for the `OPERATIONAL_LOGS` period.',\n outcome: 'Retention purges scale with one bulk delete instead of N per-row deletes. `purgeOld` never touches a non-terminal row; the sweep reaches one only when no attempt has moved it for a whole period, which means the drain has abandoned it.',\n whenToUse: 'Never a public HTTP surface. Admins purge via the `purgeOld` custom operation, which owns request validation and the purge summary response.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The matched terminal records were bulk-deleted; the body carries `deletedIds` and `deletedCount`, and the `purgeOld` wrapper reports the count in its own summary response.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system caller attempts the repository-only bulk delete directly; UI/API flows must use `purgeOld`.' },\n ],\n idempotent: true,\n },\n [M2MWebhookDeliveryLog_Operations.RETRY]: {\n operationId: M2MWebhookDeliveryLog_Operations.RETRY,\n purpose: 'Re-queue a `failed` row (reset to pending / zero attempts per worker contract) for manual replay.',\n outcome: 'Operators can attempt redelivery after fixing the downstream listener without re-sending the originating business event.',\n whenToUse: 'Use after a partner confirms their endpoint or certificate is healthy again.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The `failed` record was reset to `pending` with attempt counters cleared, and the worker pool will re-attempt delivery; the re-queued record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to retry.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to trigger a manual redelivery, or the scope does not hold the webhook-delivery entitlement (`FEATURE_NOT_AVAILABLE`): a redelivery uses the capability (#3162).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Only a `failed` row can be sent again; this one is still `pending` or `in_flight`, or already `delivered`.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Retry after the receiver recovers',\n request: {},\n response: retriedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [M2MWebhookDeliveryLog_Operations.PURGE_OLD]: {\n operationId: M2MWebhookDeliveryLog_Operations.PURGE_OLD,\n purpose: 'Bulk-delete rows older than `N` days (delivered or failed) to bound storage in busy tenants.',\n outcome: 'Tenants can comply with a data-retention policy without asking an operator to remove records by hand.',\n whenToUse: 'Use in scheduled admin jobs (or manual compliance runs) with explicit `olderThanDays` guardrails.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'Records older than the supplied `olderThanDays` window were bulk-deleted and a count of purged records is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `olderThanDays` guardrail is missing, non-numeric, or below the configured minimum retention floor.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to run a bulk retention purge.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Purge terminal delivery history older than 30 days',\n request: { olderThanDays: 30 },\n response: {\n purgedCount: 47,\n message: 'Purged 47 delivered/failed webhook deliveries older than 30 day(s).',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'The `payload` field stores `z.unknown()` JSON at rest (full operation serialization per plan). It is intentionally not expanded into `fields.*` here because the shape is the arbitrary API response; treat any READ that surfaces `payload` as PII/secret handling.',\n 'Do not use `Op.DELETE` for routine UI — prefer `purgeOld` to maintain structured audit logs; single-row delete is for exceptional maintenance.',\n 'Because payloads may embed serialized API responses, treat READ/LIST as sensitive: scope RBAC to org-admin or app-super-admin roles that already see customer data.',\n ],\n }),\n { resourcePrimaryScope: m2mDeliveryLogResourcePrimaryScope[resourceType] },\n );\n}\n\nexport const organizationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n\nexport const applicationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n"]}
|
|
1
|
+
{"version":3,"file":"m2m-webhook-delivery-log.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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c,EAAE;oBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,yGAAyG,EAAE;oBACjK,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+FAA+F,EAAE;oBACrJ,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,4PAA4P,EAAE;iBAClT;gBACD,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,CAAC;wBACT,KAAK,EAAE,oDAAoD;wBAC3D,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;wBAC9B,QAAQ,EAAE;4BACR,WAAW,EAAE,EAAE;4BACf,OAAO,EAAE,qEAAqE;yBAC/E;wBACD,SAAS,EAAE,sBAAsB,CAAC,MAAM;qBACzC,CAAC;aACH;SACF;QACD,mBAAmB,EAAE;YACnB,sQAAsQ;YACtQ,gJAAgJ;YAChJ,qKAAqK;SACtK;KACF,CAAC,EACF,EAAE,oBAAoB,EAAE,kCAAkC,CAAC,YAAY,CAAC,EAAE,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sDAAsD,GAAG,uCAAuC,CAC3G,gBAAgB,CAAC,qCAAqC,EACtD,uCAAuC,CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,qDAAqD,GAAG,uCAAuC,CAC1G,gBAAgB,CAAC,oCAAoC,EACrD,sCAAsC,CACvC,CAAC","sourcesContent":["/**\n * Resources: `organizationM2mWebhookDeliveryLog` + `applicationM2mWebhookDeliveryLog` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic ORG + APP pair sharing `M2MWebhookDeliveryLogBaseSchema` and `m2mWebhookDeliveryLogPolymorphicFactories`.\n *\n * Inputs:\n * - Base schema: `M2MWebhookDeliveryLogBaseSchema` (`m2m-webhook-delivery-log.shared.schemas.ts`)\n * - Polymorphic factories: `m2mWebhookDeliveryLogPolymorphicFactories` (`m2m-webhook-delivery-log.shared.resources-config.schemas.ts`)\n * - Custom operations: `M2MWebhookDeliveryLog_Operations` (`retry`, `purgeOld`)\n * - UI presets: `webhooksMainPresets` / `webhooksAdminPresets`\n * (engine/presets-components/src/config/resources/webhooks.resource-presets.tsx) —\n * a section-less layout surfaced in the org Settings Hub `webhooks` section\n * (Delivery log sub-tab), dashboard-style via generic collection capabilities:\n * status quick-filter tab strip (`collectionDisplayConfig.quickFilterField`)\n * + day-bucket date headings (`temporalGroupField: 'createdAt'`) on LIST,\n * EMBEDDED READ (row click → companion drawer): the resource · operation as the\n * title and the status badge on the facts line under it, then one flat list of facts with empty\n * rows hidden, and the opaque `payload` last, unlabelled, as pretty JSON.\n * Cards show the status, URL, labelled attempt count and failure reason.\n * `retry` / `purgeOld` actions.\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreM2MNotificationChannel,\n CoreResourceOperation as Op,\n CoreResourceType,\n M2MWebhookDeliveryLog_Operations,\n M2MWebhookDeliveryLogBaseSchema,\n M2MWebhookDeliveryLogStatus,\n M2MWebhookEventType,\n ResourcePrimaryScope,\n m2mWebhookDeliveryLogPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification, type ResourceSpecificationConfig } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype M2mDeliveryLogResourceType =\n | CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG\n | CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG;\n\ntype M2mDeliveryLogResourceTypeMember =\n | 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG'\n | 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG';\n\nconst m2mDeliveryLogResourcePrimaryScope: Record<M2mDeliveryLogResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype M2mDeliveryFactoryCfg = ReturnType<\n (typeof m2mWebhookDeliveryLogPolymorphicFactories)[CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]\n>;\ntype M2mDeliveryCustomOp = NonNullable<M2mDeliveryFactoryCfg['customOperation']>;\ntype M2mDeliveryCoreOp =\n | Op.READ\n | Op.LIST\n | Op.SEARCH\n | Op.CREATE\n | Op.UPDATE\n | Op.DELETE\n | Op.DELETE_MANY;\ntype M2mDeliveryMain = typeof M2MWebhookDeliveryLogBaseSchema;\n\nfunction buildM2mWebhookDeliveryLogSpecification(\n resourceType: M2mDeliveryLogResourceType,\n memberName: M2mDeliveryLogResourceTypeMember,\n): ResourceSpecificationConfig<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain> {\n const isOrganizationScope = resourceType === CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG;\n const scopeIdentity = isOrganizationScope\n ? { organizationId: 'org_01JEXAMPLE' }\n : { applicationId: 'app_01JEXAMPLE' };\n const channel = isOrganizationScope\n ? CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION\n : CoreM2MNotificationChannel.WEBHOOK_APPLICATION;\n const deliveryIdentity = {\n _id: 'delivery_01JEXAMPLE',\n endpointId: 'orders-primary',\n channel,\n resourceIdentifier: 'orders',\n operationIdentifier: 'create',\n httpUrl: 'https://partners.example.com/webhooks/orders',\n payloadHash: '31da863f127a6c22b91b5cc85081c382b02039a9c8c4b30db2cc3172de31d2d8',\n payload: { event: 'order.created', orderId: 'order_01JEXAMPLE' },\n signatureJti: 'webhook-signature-01JEXAMPLE',\n createdAt: '2026-08-18T09:30:00.000Z',\n updatedAt: '2026-08-18T09:32:12.000Z',\n ...scopeIdentity,\n } as const;\n const failedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.FAILED,\n attemptCount: 5,\n lastAttemptAt: '2026-08-18T09:32:12.000Z',\n responseStatus: 503,\n responseBodyTruncated: 'Service temporarily unavailable',\n failureReason: 'The receiver returned HTTP 503 after the final retry.',\n failedAt: '2026-08-18T09:32:12.000Z',\n } as const;\n const retriedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.PENDING,\n attemptCount: 0,\n nextAttemptAt: '2026-08-18T09:35:00.000Z',\n } as const;\n const deliveryPageExample = {\n data: [failedDeliveryExample],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n } as const;\n\n return resourceSpecification<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain>(\n m2mWebhookDeliveryLogPolymorphicFactories[resourceType],\n M2MWebhookDeliveryLogBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Persist one record per outbound endpoint delivery (queue entry, attempt count, latest HTTP evidence, and signing metadata) for org- or app-scoped admin review and retry.',\n businessRole: 'The user-visible event log and the worker’s durable queue for asynchronous webhook delivery — one row per (scope × target endpoint × fire).',\n lifecycleRole: 'Rows move PENDING → IN_FLIGHT → DELIVERED, or PENDING/IN_FLIGHT → FAILED, with `attemptCount` and `nextAttemptAt` governing back-off; RETRY and PURGE_OLD custom ops re-queue or clean history.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.NOTIFICATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'm2mWebhookDeliveryLogPolymorphicFactories',\n symbolKind: CodeSymbolKind.FACTORY,\n },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName,\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLog_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'The polymorphism engine injects `organizationId` (ORG variant) or `applicationId` (APP variant) on the document — those FKs are not on the base Zod object.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Unique id for a single delivery log record and lease token anchor for the worker.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n endpointId: schemaShape.endpointId.stringSpec({\n meaning: 'Stable FK to `webhookConfig.endpoints[].id` at enqueue time so historical records survive endpoint renames/URL changes.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n channel: schemaShape.channel.enumSpec({\n meaning: 'Which M2M channel the originating operation fired (must be compatible with the resource’s primary scope in the dispatcher).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreM2MNotificationChannel',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION]: { meaning: 'Org-scoped outbound webhook (requires an org id in the execution context).' },\n [CoreM2MNotificationChannel.WEBHOOK_APPLICATION]: { meaning: 'App-scoped outbound webhook (resolves the app id from `appConfigService`).' },\n },\n }),\n eventType: schemaShape.eventType.enumSpec({\n meaning: 'What the delivery reports, sent as its event header so a receiver can route before parsing the body. A row written before events existed reported a completed operation, so that is its value.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookEventType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [M2MWebhookEventType.OPERATION_COMPLETED]: { meaning: 'The operation succeeded: inline, or as a background run.' },\n [M2MWebhookEventType.OPERATION_FAILED]: { meaning: 'A background run of the operation failed.' },\n },\n }),\n jobId: schemaShape.jobId.stringSpec({\n meaning: 'The background job the delivery reports on: present for every `operation.failed`, and for an `operation.completed` produced by a background run. Absent for an inline call, which has no job.',\n semanticRole: 'code',\n }),\n resourceIdentifier: schemaShape.resourceIdentifier.stringSpec({\n meaning: 'Originating `CoreResourceType` string (or app resource key) that produced the M2M payload.',\n semanticRole: 'code',\n }),\n operationIdentifier: schemaShape.operationIdentifier.stringSpec({\n meaning: 'Operation or custom-op identifier that the serializer used when building the POST body (used for support correlation).',\n semanticRole: 'code',\n }),\n variantKey: schemaShape.variantKey.stringSpec({\n meaning: 'Optional default vs named operation variant, when the originating op exposed multiple API variants.',\n }),\n httpUrl: schemaShape.httpUrl.stringSpec({\n meaning: 'Snapshot of the destination URL captured when this delivery was queued (duplicated from the config so URL edits do not rewrite history).',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'uri',\n }),\n payloadHash: schemaShape.payloadHash.stringSpec({\n meaning: 'SHA-256 of the JSON body, mirrored into the signed JWT and used to detect replays or tampering.',\n semanticRole: 'code',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Current queue/delivery state for the worker and admin filters.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n },\n values: {\n [M2MWebhookDeliveryLogStatus.PENDING]: { meaning: 'Record is either waiting in the queue or has been re-queued for another attempt after a transient failure.' },\n [M2MWebhookDeliveryLogStatus.IN_FLIGHT]: { meaning: 'A worker currently holds a lease and is trying to send the HTTP request.' },\n [M2MWebhookDeliveryLogStatus.DELIVERED]: { meaning: 'The consumer returned a 2xx acknowledgement; terminal delivery success. This does not establish whether the consumer verified the signature or completed downstream processing.' },\n [M2MWebhookDeliveryLogStatus.FAILED]: { meaning: 'Terminal failure: exhausted attempt budget or a non-retryable 4xx class error.' },\n },\n }),\n attemptCount: schemaShape.attemptCount.numberSpec({\n meaning: 'Number of send attempts (including successes that still increment the counter, per worker policy).',\n unit: 'count',\n }),\n lastAttemptAt: schemaShape.lastAttemptAt.dateSpec({\n meaning: 'When the most recent send attempt started or finished, depending on writer semantics.',\n temporalRole: 'occurred',\n }),\n nextAttemptAt: schemaShape.nextAttemptAt.dateSpec({\n meaning: 'When a PENDING delivery becomes eligible for retry; indexed with status for worker polling. Terminal rows can retain an earlier value, which does not schedule another attempt.',\n temporalRole: 'scheduled',\n }),\n responseStatus: schemaShape.responseStatus.numberSpec({\n meaning: 'Last observed HTTP status code (present even for successes for observability).',\n }),\n responseBodyTruncated: schemaShape.responseBodyTruncated.stringSpec({\n meaning: 'First 4 KB of the HTTP response (when captured) to help debug remote listener failures.',\n }),\n failureReason: schemaShape.failureReason.stringSpec({\n meaning: 'Human-readable last error string when `status=failed` (worker-set).',\n }),\n signatureJti: schemaShape.signatureJti.stringSpec({\n meaning: 'Stable delivery identity carried in the JWT `jti` claim inside `x-wildo-webhook-signature`. The receiver uses it to deduplicate retries; it is not a signing-key identifier.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n deliveredAt: schemaShape.deliveredAt.dateSpec({\n meaning: 'Timestamp when a terminal `delivered` state was recorded.',\n temporalRole: 'occurred',\n }),\n failedAt: schemaShape.failedAt.dateSpec({\n meaning: 'Timestamp when a terminal `failed` state was recorded.',\n temporalRole: 'occurred',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the record was enqueued (immutable upper bound for retention policies).',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When status / attempt counters / timestamps last changed for this id.',\n temporalRole: 'modified',\n }),\n },\n // `payload` is `z.unknown()`, which carries no spec decorators, so its meaning is declared\n // through the escape hatch rather than dropped.\n additionalFieldSpecs: [\n {\n fieldName: 'payload',\n specDecorator: 'objectSpec',\n params: {\n meaning: 'The exact JSON body that was sent, as text: the originating operation’s result as its API response returns it, without internal versioning metadata. `payloadHash` is the SHA-256 of this text.',\n whyItMatters: 'It carries whatever the resource row carried, routinely personal data, so treat it as sensitive.',\n },\n },\n ],\n operations: {\n [Op.READ]: {\n /*\n * `payload` is stored opaquely and is deliberately not broken into documented fields.\n * That is a storage decision the reader of this sentence does not need; what they DO\n * need is that it comes back whole and carries whatever the event carried.\n */\n purpose: 'Inspect one delivery attempt using the fields documented above (status, URL snapshot, hashes, HTTP evidence, correlation ids). The stored `payload` is returned whole rather than broken into documented fields — treat it as sensitive; see `businessConstraints`.',\n outcome: 'Operators can see whether a business event was delivered and, if not, the precise failure class.',\n whenToUse: 'Use when triaging a customer ticket referencing a `deliveryLogId` or `signatureJti`.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery log record for the supplied id was found and its status, URL snapshot, HTTP evidence, and signing metadata are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id in this scope (never enqueued, or already removed by `purgeOld`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role; because `payload` may embed serialized customer data, reads are gated to roles that already see that data (see `businessConstraints`).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect a failed order webhook delivery',\n response: failedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse recent delivery attempts in chronological order, filtered by the repository’s search defaults.',\n outcome: 'Admins can scan for spikes in `failed` rows or revalidation after URL rotation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) chronological page of delivery log records in this scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to browse the delivery log (rows may carry serialized customer payloads).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent delivery attempts',\n request: { page: 1, limit: 20, sort: 'createdAt:desc' },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Filter log rows on status, `endpointId`, channel, date windows, and operation identifiers to isolate incidents.',\n outcome: 'Security and ops can produce CSV-grade subsets without an external data warehouse in small deployments.',\n whenToUse: 'Use in admin dashboards; heavy analytics may still go to a warehouse — this is the operational “small query” path.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of delivery log records matching the status / endpoint / channel / date-window / operation filters.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to search the delivery log.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find failures for one endpoint',\n request: {\n q: 'orders',\n status: M2MWebhookDeliveryLogStatus.FAILED,\n channel,\n endpointId: 'orders-primary',\n page: 1,\n limit: 20,\n sort: 'createdAt:desc',\n },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Enqueue a new delivery row when a resource operation with an M2M channel fires.',\n outcome: 'The worker pool can find ready rows via the `(status, nextAttemptAt)` index.',\n whenToUse: 'Repository-only: invoked by the dispatcher, never by a human HTTP client.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A `pending` delivery record was enqueued and is now discoverable by the worker pool. Internal/service write path — the dispatcher fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The enqueue payload fails schema validation (e.g. missing `endpointId`, `httpUrl`, or `channel`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to enqueue a delivery row directly.' },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Drive the delivery lifecycle status transitions (PENDING → IN_FLIGHT → DELIVERED/FAILED) with `attemptCount` / `nextAttemptAt` / terminal-timestamp writes.',\n outcome: 'The worker can advance a row through its lifecycle so the `(status, nextAttemptAt)` index stays accurate for polling and back-off.',\n whenToUse: 'Repository-only: invoked by the dispatcher/worker (`markInFlight` / `markDelivered` / `markFailedAttempt` / `markFinallyFailed`), never by a human HTTP client — admins act via the `RETRY` custom operation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery record’s status / attempt counters / timestamps were updated. Internal/service write path — the worker fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to update.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to mutate a delivery row directly; UI flows must use the `RETRY` custom operation.' },\n ],\n idempotent: false,\n },\n [Op.DELETE]: {\n purpose: 'Reserved for `purgeOld` and internal cleanup — no public single-row delete to keep the audit trail honest.',\n outcome: 'Old rows are removed in bulk, not opportunistically per UI click, matching the high-risk gating in the config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'An internal/maintenance single-record delete completed; the body carries its `id`. Intentionally not a public per-click operation — routine cleanup goes through `purgeOld`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to delete.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an operator authorized for exceptional single-row maintenance deletes; UI flows must use `purgeOld` instead.' },\n ],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'The bulk delete behind `purgeOld` and the retention-class sweep, through its route-less INTERNAL_CALL variant: `purgeOld` removes terminal rows older than the requested window a page of at most 100 rows at a time (#2297), and the sweep removes any row untouched for the `OPERATIONAL_LOGS` period.',\n outcome: 'Retention purges remove rows a page at a time, each page its own transaction with its own audit row, kept through a crash. `purgeOld` never touches a non-terminal row; the sweep reaches one only when no attempt has moved it for a whole period, which means the drain has abandoned it.',\n whenToUse: 'Never a public HTTP surface. Admins purge via the `purgeOld` custom operation, which owns request validation and the purge summary response.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The matched terminal records were bulk-deleted; the body carries `deletedIds` and `deletedCount`, and the `purgeOld` wrapper reports the count in its own summary response.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system caller attempts the repository-only bulk delete directly; UI/API flows must use `purgeOld`.' },\n ],\n idempotent: true,\n },\n [M2MWebhookDeliveryLog_Operations.RETRY]: {\n operationId: M2MWebhookDeliveryLog_Operations.RETRY,\n purpose: 'Re-queue a `failed` row (reset to pending / zero attempts per worker contract) for manual replay.',\n outcome: 'Operators can attempt redelivery after fixing the downstream listener without re-sending the originating business event.',\n whenToUse: 'Use after a partner confirms their endpoint or certificate is healthy again.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The `failed` record was reset to `pending` with attempt counters cleared, and the worker pool will re-attempt delivery; the re-queued record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to retry.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to trigger a manual redelivery, or the scope does not hold the webhook-delivery entitlement (`FEATURE_NOT_AVAILABLE`): a redelivery uses the capability (#3162).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Only a `failed` row can be sent again; this one is still `pending` or `in_flight`, or already `delivered`.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Retry after the receiver recovers',\n request: {},\n response: retriedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [M2MWebhookDeliveryLog_Operations.PURGE_OLD]: {\n operationId: M2MWebhookDeliveryLog_Operations.PURGE_OLD,\n purpose: 'Remove rows older than `N` days (delivered or failed) to bound storage in busy tenants, except a row an active legal hold keeps.',\n outcome: 'Tenants can comply with a data-retention policy without asking an operator to remove records by hand. The rows are removed a page of at most 100 at a time, each page its own transaction with its own audit row (#2297), so a crash never loses the record of a removal; when a page fails, the pages before it stay removed and recorded, and running the purge again removes the rest.',\n whenToUse: 'Use in scheduled admin jobs (or manual compliance runs) with explicit `olderThanDays` guardrails.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'Records older than the supplied `olderThanDays` window were removed, except those an active legal hold keeps (the message counts them), and a count of purged records is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `olderThanDays` guardrail is missing, non-numeric, or below the configured minimum retention floor.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to run a bulk retention purge.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A legal hold was placed on a row between the purge reading its page and removing it (`legal_hold_active`): that page is refused whole, the pages before it stay removed and recorded, and running the purge again keeps the held row and removes the rest.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Purge terminal delivery history older than 30 days',\n request: { olderThanDays: 30 },\n response: {\n purgedCount: 47,\n message: 'Purged 47 delivered/failed webhook deliveries older than 30 day(s).',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'The `payload` field stores `z.unknown()` JSON at rest (full operation serialization per plan). It is intentionally not expanded into `fields.*` here because the shape is the arbitrary API response; treat any READ that surfaces `payload` as PII/secret handling.',\n 'Do not use `Op.DELETE` for routine UI — prefer `purgeOld` to maintain structured audit logs; single-row delete is for exceptional maintenance.',\n 'Because payloads may embed serialized API responses, treat READ/LIST as sensitive: scope RBAC to org-admin or app-super-admin roles that already see customer data.',\n ],\n }),\n { resourcePrimaryScope: m2mDeliveryLogResourcePrimaryScope[resourceType] },\n );\n}\n\nexport const organizationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n\nexport const applicationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-custom-domains.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-custom-domains.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAE3B,8BAA8B,EAC9B,oCAAoC,EAGrC,MAAM,uBAAuB,CAAC;AAuC/B,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"organization-custom-domains.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-custom-domains.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAE3B,8BAA8B,EAC9B,oCAAoC,EAGrC,MAAM,uBAAuB,CAAC;AAuC/B,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;iCAoJ1D,CAAC"}
|
|
@@ -162,7 +162,8 @@ export const organizationCustomDomainsResourceSpecification = resourceSpecificat
|
|
|
162
162
|
importance: FieldSemanticImportance.PRIMARY,
|
|
163
163
|
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Ownership is proven; the updated domain is returned.' }],
|
|
164
164
|
errorScenarios: [
|
|
165
|
-
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization, the organization\'s plan does not include custom branding
|
|
165
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization, or the organization\'s plan does not include custom branding.' },
|
|
166
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is already VERIFIED (the operation is disabled for it).' },
|
|
166
167
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' },
|
|
167
168
|
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The TXT record was not found at `_wildo-verification.{domain}`.' },
|
|
168
169
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is reserved by the application, another organization has already proven it owns the domain, or the claim changed while it was being verified.' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-custom-domains.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-custom-domains.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,oCAAoC,EACpC,oBAAoB,EACpB,oEAAoE,GACrE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAA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ACF;IACD,mBAAmB,EAAE;QACnB,qKAAqK;QACrK,gJAAgJ;QAChJ,wFAAwF;KACzF;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationCustomDomains` — Wildo SaaS engine specification for an organization's own domain for the\n * application (#2974).\n *\n * Inputs:\n * - Schema: `OrganizationCustomDomainSchema` (`organizations/organization-custom-domains.shared.schemas.ts`)\n * - Factory: `organizationCustomDomainsResourceConfiguration_InitializationFactory`\n * (`organizations/organization-custom-domains.shared.resources-config.schemas.ts`)\n * - Custom operations: `OrganizationCustomDomains_Operations` (`claim`, `verify_ownership`, `remove`), all\n * OVERRIDE_ALL in `organization-custom-domains.custom-impl.backend.service.ts` (saas-backend-lib), driving\n * `OrganizationCustomDomainsBackendService`.\n * - Readers: the backend's custom-domain host resolver (CORS and return-URL admission of the organization's origin).\n * - Writers: the verbs, the `custom-domain-recheck` batch (suspends a domain whose ownership record disappeared),\n * and the organization deletion's cascade.\n *\n * Scope: the ORGANIZATIONS → ORGANIZATION_CUSTOM_DOMAINS relationship carries `isPrimaryScope: true`.\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationCustomDomainSchema,\n OrganizationCustomDomainStatus,\n OrganizationCustomDomains_Operations,\n ResourcePrimaryScope,\n organizationCustomDomainsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst EXAMPLE_ORGANIZATION_ID = 'org_01J4P8F1M2N3Q4R5S6T7FIRM01';\nconst EXAMPLE_CUSTOM_DOMAIN_ID = '66f6a1c2e3d4b5a697884001';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst page = <T>(data: readonly T[]) => ({ data, pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 } });\n\nconst ADMIN_FORBIDDEN = { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization.' };\nconst ENTITLEMENT_FORBIDDEN = { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The organization\\'s plan does not include custom branding (`CUSTOM_BRANDING`).' };\n\nconst pendingDomainExample = {\n _id: EXAMPLE_CUSTOM_DOMAIN_ID,\n organizationId: EXAMPLE_ORGANIZATION_ID,\n domain: 'app.client-firm.example',\n ownershipChallenge: { txtName: '_wildo-verification.app.client-firm.example', nonceHash: 'a3f1c9e2b4d6f8a0c2e4f6a8b0d2f4a6c8e0a2c4e6a8c0e2a4c6e8a0c2e4a6c8' },\n status: OrganizationCustomDomainStatus.OWNERSHIP_PENDING,\n ownershipVerifiedAt: null,\n lastVerifiedAt: null,\n createdAt: '2026-11-10T08:00:00.000Z',\n updatedAt: '2026-11-10T08:00:00.000Z',\n};\n\nconst verifiedDomainExample = {\n ...pendingDomainExample,\n status: OrganizationCustomDomainStatus.VERIFIED,\n ownershipVerifiedAt: '2026-11-10T08:20:00.000Z',\n lastVerifiedAt: '2026-11-10T08:20:00.000Z',\n updatedAt: '2026-11-10T08:20:00.000Z',\n};\n\nexport const organizationCustomDomainsResourceSpecification = resourceSpecification(\n organizationCustomDomainsResourceConfiguration_InitializationFactory,\n OrganizationCustomDomainSchema,\n ({ schemaShape }) => ({\n purpose: 'Let an organization have the application answer on a domain of its own, once it has proven it controls that domain\\'s DNS.',\n businessRole: 'What lets an organization\\'s members use the application on `app.client-firm.com` instead of the application\\'s shared host. Ownership is proven per organization before the host answers for anyone: the first organization to prove it holds the domain against every other.',\n lifecycleRole: '`claim` records OWNERSHIP_PENDING and returns the DNS TXT challenge once; `verify_ownership` resolves it and, for the first organization to prove it, makes the domain VERIFIED; the scheduled re-check suspends a verified domain whose ownership record disappeared, and `verify_ownership` brings it back. `remove`, and the deletion of the organization, delete the row and the domain stops being served.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'OrganizationCustomDomainSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'organizationCustomDomainsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ORGANIZATION_CUSTOM_DOMAINS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation'), customEnum: enumDeclaration('OrganizationCustomDomains_Operations') },\n notes: [\n 'The three verbs are the whole write surface, each OVERRIDE_ALL and each audited under its own event. CREATE and UPDATE are REPOSITORY_ONLY and DELETE / DELETE_MANY are INTERNAL_CALL: a row that could be written directly could claim VERIFIED without proving anything.',\n 'Only the SHA-256 of the ownership challenge value is stored. The value (`wildo-app-domain-verification=<nonce>`, published at `_wildo-verification.{domain}`) is answered once by `claim`; claiming again while pending mints a fresh one and invalidates the old.',\n 'A VERIFIED domain is served only while the organization holds `CUSTOM_BRANDING`. The host resolver asks the entitlement on every resolution, so losing the plan stops the domain being served without writing anything, and regaining it serves the domain again.',\n 'Refusals never name the organization that holds a domain: telling one tenant which tenant holds it would disclose a customer\\'s configuration.',\n '`retain_only` and FORBIDDEN from a subject export: a domain names an organization\\'s infrastructure, not a person.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identifier of one organization\\'s claim on one domain, derived from the organization and the domain.', semanticRole: 'identifier', importance: FieldSemanticImportance.PRIMARY }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization that claimed the domain.', whyItMatters: 'Once proven, the domain answers for this organization only.', importance: FieldSemanticImportance.PRIMARY }),\n domain: schemaShape.domain.stringSpec({ meaning: 'The lower-case DNS hostname, e.g. `app.client-firm.com`.', whyItMatters: 'Not unique: several organizations may hold pending claims on one domain. The application\\'s own hosts and their subdomains cannot be claimed.', importance: FieldSemanticImportance.PRIMARY }),\n ownershipChallenge: schemaShape.ownershipChallenge.objectSpec({ meaning: 'The DNS TXT ownership challenge: the name to publish it on, and the SHA-256 of the value.', whyItMatters: 'The organization proves control of the domain by publishing the value; the re-check keeps asking for it, and its disappearance suspends the domain.' }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where the domain stands. Only a verified domain is served.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: enumDeclaration('OrganizationCustomDomainStatus'),\n values: {\n [OrganizationCustomDomainStatus.OWNERSHIP_PENDING]: { meaning: 'Claimed; the TXT challenge is not answered yet. Blocks nobody: several organizations may be here at once.' },\n [OrganizationCustomDomainStatus.VERIFIED]: { meaning: 'Ownership proven. The domain is served for the organization while it holds custom branding.' },\n [OrganizationCustomDomainStatus.SUSPENDED]: { meaning: 'Was verified; the ownership record disappeared. Not served until ownership is proven again.' },\n },\n }),\n ownershipVerifiedAt: schemaShape.ownershipVerifiedAt.dateSpec({ meaning: 'When the organization proved it owns the domain.', whyItMatters: 'From then on the domain is refused to every other organization.', temporalRole: 'occurred' }),\n lastVerifiedAt: schemaShape.lastVerifiedAt.dateSpec({ meaning: 'When the ownership record was last found published.', temporalRole: 'occurred' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the domain was claimed.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the claim last changed.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one of your organization\\'s custom domains, with its status and where to publish the ownership record.',\n outcome: 'The domain claim.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The domain is returned.' }],\n errorScenarios: [ADMIN_FORBIDDEN, { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' }],\n idempotent: true,\n examples: [{ title: 'Read a claimed domain', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID }, response: pendingDomainExample, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.LIST]: {\n purpose: 'List the organization\\'s custom domains, filtered by `status` and sorted by `createdAt`.',\n outcome: 'A page of domain claims.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'A possibly empty page of domains.' }],\n errorScenarios: [ADMIN_FORBIDDEN],\n idempotent: true,\n examples: [{ title: 'List verified domains', request: { organizationId: EXAMPLE_ORGANIZATION_ID, status: OrganizationCustomDomainStatus.VERIFIED }, response: page([verifiedDomainExample]), forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.CREATE]: {\n purpose: 'Store a claim. Written only by `claim`.',\n outcome: 'The claim exists OWNERSHIP_PENDING.',\n whenToUse: 'Repository-only: never an HTTP surface — organizations act through `claim`.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The claim was stored. Internal write path.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization already holds a claim on this domain.' }],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Move a claim through its lifecycle. Written only by the verbs and the re-check, through guarded mutations.',\n outcome: 'The claim reflects the latest ownership check.',\n whenToUse: 'Repository-only: never an HTTP surface.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The claim was updated. Internal write path.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No claim with this id exists.' }],\n idempotent: false,\n },\n [Op.DELETE]: {\n purpose: 'Internal, route-less delete (HIGH risk): the tenant cascade\\'s door when the organization is deleted.',\n outcome: 'The claim leaves with its organization, and the domain stops being served.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Internal delete completed.' }],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Bulk twin of DELETE (internal, route-less).',\n outcome: 'An organization\\'s claims leave together.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Internal delete completed.' }],\n idempotent: true,\n },\n [OrganizationCustomDomains_Operations.CLAIM]: {\n operationId: OrganizationCustomDomains_Operations.CLAIM,\n purpose: 'Claim a domain for the application and receive the DNS TXT record that proves ownership.',\n outcome: 'The claim is OWNERSHIP_PENDING and the answer carries `txtName` (`_wildo-verification.{domain}`) and `txtValue` (`wildo-app-domain-verification=<nonce>`), shown this once. Nothing is served yet. Claiming again while pending mints a fresh value and invalidates the old one.',\n whenToUse: 'The organization wants its members to use the application on a domain it controls.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The claim and its one-time TXT record value are returned.' }],\n errorScenarios: [\n ADMIN_FORBIDDEN,\n ENTITLEMENT_FORBIDDEN,\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The domain is not a DNS hostname with at least two labels, or ends in a numeric label.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is one of the application\\'s own hosts or under its domain, another organization has already proven it owns the domain, or this organization already proved it (remove the domain to claim it again).' },\n ],\n idempotent: false,\n examples: [{\n title: 'Claim a subdomain of the organization\\'s own domain',\n request: { organizationId: EXAMPLE_ORGANIZATION_ID, domain: 'app.client-firm.example' },\n response: { organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID, domain: 'app.client-firm.example', status: OrganizationCustomDomainStatus.OWNERSHIP_PENDING, txtName: '_wildo-verification.app.client-firm.example', txtValue: 'wildo-app-domain-verification=Qm9vc3RlZC1ub25jZS12YWx1ZS0x' },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationCustomDomains_Operations.VERIFY_OWNERSHIP]: {\n operationId: OrganizationCustomDomains_Operations.VERIFY_OWNERSHIP,\n purpose: 'Prove ownership: resolve the published TXT record. The first organization to prove it holds the domain.',\n outcome: 'The domain is VERIFIED with `ownershipVerifiedAt`. From then on it is refused to every other organization, and it is served for this one while it holds custom branding. A SUSPENDED domain comes back the same way.',\n whenToUse: 'After publishing the TXT record `claim` returned and letting DNS propagate, or after publishing it again for a suspended domain.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Ownership is proven; the updated domain is returned.' }],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization, the organization\\'s plan does not include custom branding, or the domain is already VERIFIED (the operation is disabled for it).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The TXT record was not found at `_wildo-verification.{domain}`.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is reserved by the application, another organization has already proven it owns the domain, or the claim changed while it was being verified.' },\n ],\n idempotent: false,\n examples: [{ title: 'Prove ownership of a claimed domain', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID }, response: verifiedDomainExample, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [OrganizationCustomDomains_Operations.REMOVE]: {\n operationId: OrganizationCustomDomains_Operations.REMOVE,\n purpose: 'Remove a domain: delete the claim.',\n outcome: 'The domain stops being served for the organization at once. Never needs the custom-branding entitlement.',\n whenToUse: 'The organization no longer uses the domain, or wants to claim it again from the start.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The domain was removed.' }],\n errorScenarios: [ADMIN_FORBIDDEN, { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' }],\n idempotent: false,\n examples: [{\n title: 'Remove a verified domain',\n request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID },\n response: { organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID, domain: 'app.client-firm.example' },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'A host answers for an organization only once THIS organization proved control of its DNS; the first organization to prove it wins, and pending claims block nobody.',\n 'Only a VERIFIED domain of an organization holding custom branding is served; a verified domain whose ownership record disappears is SUSPENDED.',\n 'The application\\'s own hosts, and every name under its domain, are nobody\\'s to claim.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"organization-custom-domains.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-custom-domains.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,oCAAoC,EACpC,oBAAoB,EACpB,oEAAoE,GACrE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AACjE,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAE5D,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,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E,IAAI,EAAE,0JAA0J,EAAE;aAChN;YACD,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,qCAAqC,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,sBAAsB,CAAC,MAAM,EAAE,CAAC;SACpP;QACD,CAAC,oCAAoC,CAAC,MAAM,CAAC,EAAE;YAC7C,WAAW,EAAE,oCAAoC,CAAC,MAAM;YACxD,OAAO,EAAE,oCAAoC;YAC7C,OAAO,EAAE,0GAA0G;YACnH,SAAS,EAAE,wFAAwF;YACnG,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;YAC/F,cAAc,EAAE,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,oDAAoD,EAAE,CAAC;YAC7I,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,CAAC;oBACT,KAAK,EAAE,0BAA0B;oBACjC,OAAO,EAAE,EAAE,cAAc,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE;oBAC1G,QAAQ,EAAE,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,EAAE,yBAAyB,EAAE;oBACrG,SAAS,EAAE,sBAAsB,CAAC,MAAM;iBACzC,CAAC;SACH;KACF;IACD,mBAAmB,EAAE;QACnB,qKAAqK;QACrK,gJAAgJ;QAChJ,wFAAwF;KACzF;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationCustomDomains` — Wildo SaaS engine specification for an organization's own domain for the\n * application (#2974).\n *\n * Inputs:\n * - Schema: `OrganizationCustomDomainSchema` (`organizations/organization-custom-domains.shared.schemas.ts`)\n * - Factory: `organizationCustomDomainsResourceConfiguration_InitializationFactory`\n * (`organizations/organization-custom-domains.shared.resources-config.schemas.ts`)\n * - Custom operations: `OrganizationCustomDomains_Operations` (`claim`, `verify_ownership`, `remove`), all\n * OVERRIDE_ALL in `organization-custom-domains.custom-impl.backend.service.ts` (saas-backend-lib), driving\n * `OrganizationCustomDomainsBackendService`.\n * - Readers: the backend's custom-domain host resolver (CORS and return-URL admission of the organization's origin).\n * - Writers: the verbs, the `custom-domain-recheck` batch (suspends a domain whose ownership record disappeared),\n * and the organization deletion's cascade.\n *\n * Scope: the ORGANIZATIONS → ORGANIZATION_CUSTOM_DOMAINS relationship carries `isPrimaryScope: true`.\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationCustomDomainSchema,\n OrganizationCustomDomainStatus,\n OrganizationCustomDomains_Operations,\n ResourcePrimaryScope,\n organizationCustomDomainsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst EXAMPLE_ORGANIZATION_ID = 'org_01J4P8F1M2N3Q4R5S6T7FIRM01';\nconst EXAMPLE_CUSTOM_DOMAIN_ID = '66f6a1c2e3d4b5a697884001';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst page = <T>(data: readonly T[]) => ({ data, pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 } });\n\nconst ADMIN_FORBIDDEN = { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization.' };\nconst ENTITLEMENT_FORBIDDEN = { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The organization\\'s plan does not include custom branding (`CUSTOM_BRANDING`).' };\n\nconst pendingDomainExample = {\n _id: EXAMPLE_CUSTOM_DOMAIN_ID,\n organizationId: EXAMPLE_ORGANIZATION_ID,\n domain: 'app.client-firm.example',\n ownershipChallenge: { txtName: '_wildo-verification.app.client-firm.example', nonceHash: 'a3f1c9e2b4d6f8a0c2e4f6a8b0d2f4a6c8e0a2c4e6a8c0e2a4c6e8a0c2e4a6c8' },\n status: OrganizationCustomDomainStatus.OWNERSHIP_PENDING,\n ownershipVerifiedAt: null,\n lastVerifiedAt: null,\n createdAt: '2026-11-10T08:00:00.000Z',\n updatedAt: '2026-11-10T08:00:00.000Z',\n};\n\nconst verifiedDomainExample = {\n ...pendingDomainExample,\n status: OrganizationCustomDomainStatus.VERIFIED,\n ownershipVerifiedAt: '2026-11-10T08:20:00.000Z',\n lastVerifiedAt: '2026-11-10T08:20:00.000Z',\n updatedAt: '2026-11-10T08:20:00.000Z',\n};\n\nexport const organizationCustomDomainsResourceSpecification = resourceSpecification(\n organizationCustomDomainsResourceConfiguration_InitializationFactory,\n OrganizationCustomDomainSchema,\n ({ schemaShape }) => ({\n purpose: 'Let an organization have the application answer on a domain of its own, once it has proven it controls that domain\\'s DNS.',\n businessRole: 'What lets an organization\\'s members use the application on `app.client-firm.com` instead of the application\\'s shared host. Ownership is proven per organization before the host answers for anyone: the first organization to prove it holds the domain against every other.',\n lifecycleRole: '`claim` records OWNERSHIP_PENDING and returns the DNS TXT challenge once; `verify_ownership` resolves it and, for the first organization to prove it, makes the domain VERIFIED; the scheduled re-check suspends a verified domain whose ownership record disappeared, and `verify_ownership` brings it back. `remove`, and the deletion of the organization, delete the row and the domain stops being served.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'OrganizationCustomDomainSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'organizationCustomDomainsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ORGANIZATION_CUSTOM_DOMAINS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation'), customEnum: enumDeclaration('OrganizationCustomDomains_Operations') },\n notes: [\n 'The three verbs are the whole write surface, each OVERRIDE_ALL and each audited under its own event. CREATE and UPDATE are REPOSITORY_ONLY and DELETE / DELETE_MANY are INTERNAL_CALL: a row that could be written directly could claim VERIFIED without proving anything.',\n 'Only the SHA-256 of the ownership challenge value is stored. The value (`wildo-app-domain-verification=<nonce>`, published at `_wildo-verification.{domain}`) is answered once by `claim`; claiming again while pending mints a fresh one and invalidates the old.',\n 'A VERIFIED domain is served only while the organization holds `CUSTOM_BRANDING`. The host resolver asks the entitlement on every resolution, so losing the plan stops the domain being served without writing anything, and regaining it serves the domain again.',\n 'Refusals never name the organization that holds a domain: telling one tenant which tenant holds it would disclose a customer\\'s configuration.',\n '`retain_only` and FORBIDDEN from a subject export: a domain names an organization\\'s infrastructure, not a person.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identifier of one organization\\'s claim on one domain, derived from the organization and the domain.', semanticRole: 'identifier', importance: FieldSemanticImportance.PRIMARY }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization that claimed the domain.', whyItMatters: 'Once proven, the domain answers for this organization only.', importance: FieldSemanticImportance.PRIMARY }),\n domain: schemaShape.domain.stringSpec({ meaning: 'The lower-case DNS hostname, e.g. `app.client-firm.com`.', whyItMatters: 'Not unique: several organizations may hold pending claims on one domain. The application\\'s own hosts and their subdomains cannot be claimed.', importance: FieldSemanticImportance.PRIMARY }),\n ownershipChallenge: schemaShape.ownershipChallenge.objectSpec({ meaning: 'The DNS TXT ownership challenge: the name to publish it on, and the SHA-256 of the value.', whyItMatters: 'The organization proves control of the domain by publishing the value; the re-check keeps asking for it, and its disappearance suspends the domain.' }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where the domain stands. Only a verified domain is served.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: enumDeclaration('OrganizationCustomDomainStatus'),\n values: {\n [OrganizationCustomDomainStatus.OWNERSHIP_PENDING]: { meaning: 'Claimed; the TXT challenge is not answered yet. Blocks nobody: several organizations may be here at once.' },\n [OrganizationCustomDomainStatus.VERIFIED]: { meaning: 'Ownership proven. The domain is served for the organization while it holds custom branding.' },\n [OrganizationCustomDomainStatus.SUSPENDED]: { meaning: 'Was verified; the ownership record disappeared. Not served until ownership is proven again.' },\n },\n }),\n ownershipVerifiedAt: schemaShape.ownershipVerifiedAt.dateSpec({ meaning: 'When the organization proved it owns the domain.', whyItMatters: 'From then on the domain is refused to every other organization.', temporalRole: 'occurred' }),\n lastVerifiedAt: schemaShape.lastVerifiedAt.dateSpec({ meaning: 'When the ownership record was last found published.', temporalRole: 'occurred' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the domain was claimed.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the claim last changed.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one of your organization\\'s custom domains, with its status and where to publish the ownership record.',\n outcome: 'The domain claim.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The domain is returned.' }],\n errorScenarios: [ADMIN_FORBIDDEN, { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' }],\n idempotent: true,\n examples: [{ title: 'Read a claimed domain', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID }, response: pendingDomainExample, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.LIST]: {\n purpose: 'List the organization\\'s custom domains, filtered by `status` and sorted by `createdAt`.',\n outcome: 'A page of domain claims.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'A possibly empty page of domains.' }],\n errorScenarios: [ADMIN_FORBIDDEN],\n idempotent: true,\n examples: [{ title: 'List verified domains', request: { organizationId: EXAMPLE_ORGANIZATION_ID, status: OrganizationCustomDomainStatus.VERIFIED }, response: page([verifiedDomainExample]), forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.CREATE]: {\n purpose: 'Store a claim. Written only by `claim`.',\n outcome: 'The claim exists OWNERSHIP_PENDING.',\n whenToUse: 'Repository-only: never an HTTP surface — organizations act through `claim`.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The claim was stored. Internal write path.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization already holds a claim on this domain.' }],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Move a claim through its lifecycle. Written only by the verbs and the re-check, through guarded mutations.',\n outcome: 'The claim reflects the latest ownership check.',\n whenToUse: 'Repository-only: never an HTTP surface.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The claim was updated. Internal write path.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No claim with this id exists.' }],\n idempotent: false,\n },\n [Op.DELETE]: {\n purpose: 'Internal, route-less delete (HIGH risk): the tenant cascade\\'s door when the organization is deleted.',\n outcome: 'The claim leaves with its organization, and the domain stops being served.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Internal delete completed.' }],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Bulk twin of DELETE (internal, route-less).',\n outcome: 'An organization\\'s claims leave together.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Internal delete completed.' }],\n idempotent: true,\n },\n [OrganizationCustomDomains_Operations.CLAIM]: {\n operationId: OrganizationCustomDomains_Operations.CLAIM,\n purpose: 'Claim a domain for the application and receive the DNS TXT record that proves ownership.',\n outcome: 'The claim is OWNERSHIP_PENDING and the answer carries `txtName` (`_wildo-verification.{domain}`) and `txtValue` (`wildo-app-domain-verification=<nonce>`), shown this once. Nothing is served yet. Claiming again while pending mints a fresh value and invalidates the old one.',\n whenToUse: 'The organization wants its members to use the application on a domain it controls.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The claim and its one-time TXT record value are returned.' }],\n errorScenarios: [\n ADMIN_FORBIDDEN,\n ENTITLEMENT_FORBIDDEN,\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The domain is not a DNS hostname with at least two labels, or ends in a numeric label.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is one of the application\\'s own hosts or under its domain, another organization has already proven it owns the domain, or this organization already proved it (remove the domain to claim it again).' },\n ],\n idempotent: false,\n examples: [{\n title: 'Claim a subdomain of the organization\\'s own domain',\n request: { organizationId: EXAMPLE_ORGANIZATION_ID, domain: 'app.client-firm.example' },\n response: { organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID, domain: 'app.client-firm.example', status: OrganizationCustomDomainStatus.OWNERSHIP_PENDING, txtName: '_wildo-verification.app.client-firm.example', txtValue: 'wildo-app-domain-verification=Qm9vc3RlZC1ub25jZS12YWx1ZS0x' },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationCustomDomains_Operations.VERIFY_OWNERSHIP]: {\n operationId: OrganizationCustomDomains_Operations.VERIFY_OWNERSHIP,\n purpose: 'Prove ownership: resolve the published TXT record. The first organization to prove it holds the domain.',\n outcome: 'The domain is VERIFIED with `ownershipVerifiedAt`. From then on it is refused to every other organization, and it is served for this one while it holds custom branding. A SUSPENDED domain comes back the same way.',\n whenToUse: 'After publishing the TXT record `claim` returned and letting DNS propagate, or after publishing it again for a suspended domain.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Ownership is proven; the updated domain is returned.' }],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization, or the organization\\'s plan does not include custom branding.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is already VERIFIED (the operation is disabled for it).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The TXT record was not found at `_wildo-verification.{domain}`.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The domain is reserved by the application, another organization has already proven it owns the domain, or the claim changed while it was being verified.' },\n ],\n idempotent: false,\n examples: [{ title: 'Prove ownership of a claimed domain', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID }, response: verifiedDomainExample, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [OrganizationCustomDomains_Operations.REMOVE]: {\n operationId: OrganizationCustomDomains_Operations.REMOVE,\n purpose: 'Remove a domain: delete the claim.',\n outcome: 'The domain stops being served for the organization at once. Never needs the custom-branding entitlement.',\n whenToUse: 'The organization no longer uses the domain, or wants to claim it again from the start.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The domain was removed.' }],\n errorScenarios: [ADMIN_FORBIDDEN, { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No domain with this id exists in the organization.' }],\n idempotent: false,\n examples: [{\n title: 'Remove a verified domain',\n request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID },\n response: { organizationCustomDomainId: EXAMPLE_CUSTOM_DOMAIN_ID, domain: 'app.client-firm.example' },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'A host answers for an organization only once THIS organization proved control of its DNS; the first organization to prove it wins, and pending claims block nobody.',\n 'Only a VERIFIED domain of an organization holding custom branding is served; a verified domain whose ownership record disappears is SUSPENDED.',\n 'The application\\'s own hosts, and every name under its domain, are nobody\\'s to claim.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-members.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-members.resource.specification.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAK3B,wBAAwB,EACxB,8BAA8B,EAG/B,MAAM,uBAAuB,CAAC;AA2D/B,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"organization-members.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/organizations/resources/organization-members.resource.specification.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAK3B,wBAAwB,EACxB,8BAA8B,EAG/B,MAAM,uBAAuB,CAAC;AA2D/B,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;iCAkiBpD,CAAC"}
|
package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js
CHANGED
|
@@ -333,6 +333,7 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
333
333
|
],
|
|
334
334
|
errorScenarios: [
|
|
335
335
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No membership row exists for the supplied id (or it was already removed).' },
|
|
336
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The membership is still an INVITED invitation: DELETE removes accepted members only (the operation is disabled for it). Cancel the invitation with REVOKE, which also revokes its accept token.', customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_DISABLED },
|
|
336
337
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an organization admin nor a representative of another organization holding `MANAGE_RELATIONSHIP_REPRESENTATIVES` through a live capability grant this organization lent (#1631).' },
|
|
337
338
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds `MANAGE_RELATIONSHIP_REPRESENTATIVES` (a capability a granting organization lends a relationship\'s representing organization, #1631) and the target is not a representative of the SAME relationship it acts in the organization through — an ordinary member, another representing organization\'s representative, or a representative of another of its relationships. Carries `code: RELATIONSHIP_CAPABILITY_TARGET_OUTSIDE_RELATIONSHIP`.' },
|
|
338
339
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The target is the LAST administratively usable owner of the organization. Destroying the row that holds the last tenant authority strands the organization exactly as demoting it would, so it is refused on the same terms — grant an owner role to another active member first. Also returned when the membership snapshot cannot be read, since the floor must not assume an unreadable row is not the last owner.', customMessageReference: ErrorCustomMessageReference.LAST_ORGANIZATION_OWNER },
|
|
@@ -366,8 +367,8 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
366
367
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No membership row exists for the supplied id in the caller’s organization.' },
|
|
367
368
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an organization admin nor a representative of another organization holding `MANAGE_RELATIONSHIP_REPRESENTATIVES` through a live capability grant this organization lent (#1631).' },
|
|
368
369
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds `MANAGE_RELATIONSHIP_REPRESENTATIVES` (a capability a granting organization lends a relationship\'s representing organization, #1631) and the target is not a representative of the SAME relationship it acts in the organization through — an ordinary member, another representing organization\'s representative, or a representative of another of its relationships. Carries `code: RELATIONSHIP_CAPABILITY_TARGET_OUTSIDE_RELATIONSHIP`.' },
|
|
369
|
-
{ code: HttpResponseStatusCode.
|
|
370
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The membership is not ACTIVE, so this is not a legal transition — an INVITED row has not accepted yet (cancel it with REVOKE, which also revokes the accept token) and an INACTIVE or already-SUSPENDED one is already out. Carries `resource_status_transition_conflict`, whose context names the current status, the target status and the permitted source statuses, so a client can re-read and show the real state rather than treating it as an opaque clash. Most callers meet the earlier `enabledCondition` gate (
|
|
370
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The operation is unavailable because the membership is not currently ACTIVE.' },
|
|
371
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The membership is not ACTIVE, so this is not a legal transition — an INVITED row has not accepted yet (cancel it with REVOKE, which also revokes the accept token) and an INACTIVE or already-SUSPENDED one is already out. Carries `resource_status_transition_conflict`, whose context names the current status, the target status and the permitted source statuses, so a client can re-read and show the real state rather than treating it as an opaque clash. Most callers meet the earlier `enabledCondition` gate instead, also a 409 but carrying `service_resource_operation_disabled` (a state refusal, #3785); this reference covers the paths that gate does not reach.' },
|
|
371
372
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The target is the organization’s LAST administratively usable owner (an ACTIVE membership holding a role that confers `ORG_OWNER`, directly or by inheritance, whose linked user is also ACTIVE). Suspending it leaves the organization with no principal able to administer it, so the tenant cannot administer itself afterwards. Grant an owner role to another active member first. Recovery is not impossible \u2014 a platform administrator holds `grantOwnership` \u2014 but it is an out-of-tenant escalation, which is why the in-tenant refusal stands. Not a 403: the caller IS authorized; the current state of the organization forbids it. Carries the stable client-branchable `code: LAST_ORGANIZATION_OWNER` — a DIFFERENT code from the application floor, because the remedy is scoped to this organization.', customMessageReference: ErrorCustomMessageReference.LAST_ORGANIZATION_OWNER },
|
|
372
373
|
],
|
|
373
374
|
idempotent: true,
|
|
@@ -397,7 +398,7 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
397
398
|
errorScenarios: [
|
|
398
399
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No membership row exists for the supplied id in the caller’s organization.' },
|
|
399
400
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin permitted to reactivate members. Deliberately NOT opened to `MANAGE_RELATIONSHIP_REPRESENTATIVES` (#1631): a suspension is the organization\'s bar against one person, which a representing organization may never lift, even for its own representative.' },
|
|
400
|
-
{ code: HttpResponseStatusCode.
|
|
401
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The operation is unavailable because the membership is not currently SUSPENDED.' },
|
|
401
402
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The membership is not SUSPENDED, so there is nothing to reactivate — notably an INVITED row is refused here rather than being silently promoted, which would grant a membership nobody accepted. Carries `resource_status_transition_conflict` with the current and permitted statuses in its context.' },
|
|
402
403
|
],
|
|
403
404
|
idempotent: true,
|
|
@@ -423,7 +424,7 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
423
424
|
errorScenarios: [
|
|
424
425
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No membership row exists for the supplied id in the caller’s organization.' },
|
|
425
426
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an organization admin nor a representative of another organization holding `INVITE_MEMBERS` through a live capability grant this organization lent (#1631).' },
|
|
426
|
-
{ code: HttpResponseStatusCode.
|
|
427
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The operation is unavailable because the membership is no longer INVITED.' },
|
|
427
428
|
],
|
|
428
429
|
idempotent: false,
|
|
429
430
|
examples: [
|
|
@@ -469,11 +470,12 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
469
470
|
outcome: 'The member keeps their roles and gains the owner role. The organization\'s administrators are notified, and the change is recorded with the roles before and after.',
|
|
470
471
|
whenToUse: 'Adding a second owner, or the first step of handing ownership to someone else (make them an owner, then step down).',
|
|
471
472
|
responseStatuses: [
|
|
472
|
-
{ code: HttpResponseStatusCode.OK_200, meaning: 'The member is an owner.
|
|
473
|
+
{ code: HttpResponseStatusCode.OK_200, meaning: 'The member is an owner.' },
|
|
473
474
|
],
|
|
474
475
|
errorScenarios: [
|
|
475
476
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner of this organization.' },
|
|
476
477
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No membership exists for the supplied id in this organization.' },
|
|
478
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The member is already an owner, or the membership is not active: the operation is not offered on such a row (disabled), so making an existing owner an owner again is refused rather than answered as a no-op. The member\'s roles are unchanged.', customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_DISABLED },
|
|
477
479
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization\'s type offers no role that confers ownership (#2607). The door grants the type\'s founding owner role, else `ORG_OWNER`, and only when the type offers it: a role the type does not grant would confer nothing, so the organization would stay as ownerless as before.' },
|
|
478
480
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The membership is not active, or its user is not active, so the new owner would not count as one. Also returned for a membership held through an organization relationship, whose roles that relationship decides.' },
|
|
479
481
|
],
|
|
@@ -494,7 +496,8 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
494
496
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The caller is no longer an owner and is an administrator.' },
|
|
495
497
|
],
|
|
496
498
|
errorScenarios: [
|
|
497
|
-
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner, or the membership is not the caller\'s own.' },
|
|
499
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner, or the membership is an ACTIVE owner membership that is not the caller\'s own.' },
|
|
500
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The membership is not ACTIVE or does not hold the owner role (the operation is disabled for it).' },
|
|
498
501
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The caller is the organization\'s last usable owner. Make another member an owner first.', customMessageReference: ErrorCustomMessageReference.LAST_ORGANIZATION_OWNER },
|
|
499
502
|
],
|
|
500
503
|
idempotent: false,
|
|
@@ -515,7 +518,7 @@ export const organizationMembersResourceSpecification = resourceSpecificationFro
|
|
|
515
518
|
errorScenarios: [
|
|
516
519
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No membership row exists for the supplied id in the caller’s organization.' },
|
|
517
520
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an organization admin nor a representative of another organization holding `INVITE_MEMBERS` through a live capability grant this organization lent (#1631).' },
|
|
518
|
-
{ code: HttpResponseStatusCode.
|
|
521
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The operation is unavailable because the membership is no longer INVITED.' },
|
|
519
522
|
],
|
|
520
523
|
idempotent: false,
|
|
521
524
|
examples: [{
|