@endora-commerce/contracts 0.109.0 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actor.d.ts +16 -0
- package/dist/actor.d.ts.map +1 -1
- package/dist/addresses.d.ts +35 -0
- package/dist/addresses.d.ts.map +1 -1
- package/dist/addresses.js +8 -1
- package/dist/addresses.js.map +1 -1
- package/dist/admin-contributions.d.ts +62 -7
- package/dist/admin-contributions.d.ts.map +1 -1
- package/dist/admin-contributions.js +27 -8
- package/dist/admin-contributions.js.map +1 -1
- package/dist/admin-roles.d.ts +8 -2
- package/dist/admin-roles.d.ts.map +1 -1
- package/dist/admin-roles.js.map +1 -1
- package/dist/admin-users.d.ts +9 -0
- package/dist/admin-users.d.ts.map +1 -1
- package/dist/admin.d.ts +77 -4
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +79 -3
- package/dist/admin.js.map +1 -1
- package/dist/assets-library.d.ts +26 -0
- package/dist/assets-library.d.ts.map +1 -1
- package/dist/assets-library.js +6 -3
- package/dist/assets-library.js.map +1 -1
- package/dist/audit-logs.d.ts +12 -0
- package/dist/audit-logs.d.ts.map +1 -1
- package/dist/audit-logs.js +12 -0
- package/dist/audit-logs.js.map +1 -1
- package/dist/blog.d.ts +382 -22
- package/dist/blog.d.ts.map +1 -1
- package/dist/blog.js +199 -17
- package/dist/blog.js.map +1 -1
- package/dist/carts.d.ts +394 -36
- package/dist/carts.d.ts.map +1 -1
- package/dist/carts.js +131 -8
- package/dist/carts.js.map +1 -1
- package/dist/catalog.d.ts +351 -219
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +209 -157
- package/dist/catalog.js.map +1 -1
- package/dist/cms-brand.d.ts +14 -14
- package/dist/cms.d.ts +41 -16
- package/dist/cms.d.ts.map +1 -1
- package/dist/cms.js.map +1 -1
- package/dist/common.d.ts +23 -6
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +25 -2
- package/dist/common.js.map +1 -1
- package/dist/comparisons.d.ts +28 -21
- package/dist/comparisons.d.ts.map +1 -1
- package/dist/comparisons.js +2 -1
- package/dist/comparisons.js.map +1 -1
- package/dist/credit-limits.d.ts +1 -0
- package/dist/credit-limits.d.ts.map +1 -1
- package/dist/credit-limits.js +14 -0
- package/dist/credit-limits.js.map +1 -1
- package/dist/crm.d.ts +79 -49
- package/dist/crm.d.ts.map +1 -1
- package/dist/crm.js +6 -0
- package/dist/crm.js.map +1 -1
- package/dist/custom-fields.d.ts +27 -13
- package/dist/custom-fields.d.ts.map +1 -1
- package/dist/custom-fields.js +15 -1
- package/dist/custom-fields.js.map +1 -1
- package/dist/customer-accounts.d.ts +186 -22
- package/dist/customer-accounts.d.ts.map +1 -1
- package/dist/customer-accounts.js +39 -0
- package/dist/customer-accounts.js.map +1 -1
- package/dist/customers.d.ts +40 -73
- package/dist/customers.d.ts.map +1 -1
- package/dist/customers.js +45 -10
- package/dist/customers.js.map +1 -1
- package/dist/document-templates.d.ts +12 -12
- package/dist/errors.d.ts +119 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +146 -1
- package/dist/errors.js.map +1 -1
- package/dist/forms-logic.d.ts +79 -0
- package/dist/forms-logic.d.ts.map +1 -0
- package/dist/forms-logic.fixtures.d.ts +52 -0
- package/dist/forms-logic.fixtures.d.ts.map +1 -0
- package/dist/forms-logic.fixtures.js +610 -0
- package/dist/forms-logic.fixtures.js.map +1 -0
- package/dist/forms-logic.js +699 -0
- package/dist/forms-logic.js.map +1 -0
- package/dist/forms.d.ts +9833 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.js +827 -0
- package/dist/forms.js.map +1 -0
- package/dist/import-export.d.ts +180 -0
- package/dist/import-export.d.ts.map +1 -1
- package/dist/import-export.js +60 -0
- package/dist/import-export.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/inventory.d.ts +9 -9
- package/dist/invoice-ledger.d.ts +7 -7
- package/dist/invoices.d.ts.map +1 -1
- package/dist/invoices.js +4 -0
- package/dist/invoices.js.map +1 -1
- package/dist/mfa.d.ts +124 -4
- package/dist/mfa.d.ts.map +1 -1
- package/dist/mfa.js +46 -0
- package/dist/mfa.js.map +1 -1
- package/dist/modules.d.ts +36 -4
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +68 -0
- package/dist/modules.js.map +1 -1
- package/dist/money-decimal.d.ts +54 -0
- package/dist/money-decimal.d.ts.map +1 -1
- package/dist/money-decimal.js +95 -0
- package/dist/money-decimal.js.map +1 -1
- package/dist/newsletter.d.ts +4 -4
- package/dist/orders.d.ts +105 -12
- package/dist/orders.d.ts.map +1 -1
- package/dist/orders.js +60 -4
- package/dist/orders.js.map +1 -1
- package/dist/organization-registry-lookup.d.ts +362 -0
- package/dist/organization-registry-lookup.d.ts.map +1 -0
- package/dist/organization-registry-lookup.js +196 -0
- package/dist/organization-registry-lookup.js.map +1 -0
- package/dist/organization-roles.d.ts +340 -0
- package/dist/organization-roles.d.ts.map +1 -0
- package/dist/organization-roles.js +211 -0
- package/dist/organization-roles.js.map +1 -0
- package/dist/organizations.d.ts +123 -89
- package/dist/organizations.d.ts.map +1 -1
- package/dist/organizations.js +68 -24
- package/dist/organizations.js.map +1 -1
- package/dist/page-builder-props.d.ts +56 -56
- package/dist/pim-connector.d.ts +7 -3
- package/dist/pim-connector.d.ts.map +1 -1
- package/dist/pim-connector.js +6 -2
- package/dist/pim-connector.js.map +1 -1
- package/dist/pim-field-path.d.ts +5 -1
- package/dist/pim-field-path.d.ts.map +1 -1
- package/dist/pim-field-path.js +37 -81
- package/dist/pim-field-path.js.map +1 -1
- package/dist/pim-locale-mapping.d.ts +131 -0
- package/dist/pim-locale-mapping.d.ts.map +1 -0
- package/dist/pim-locale-mapping.js +193 -0
- package/dist/pim-locale-mapping.js.map +1 -0
- package/dist/price-books.d.ts +67 -63
- package/dist/price-books.d.ts.map +1 -1
- package/dist/price-books.js +6 -2
- package/dist/price-books.js.map +1 -1
- package/dist/price-lists.d.ts +8 -8
- package/dist/product-feeds.d.ts +94 -94
- package/dist/product-feeds.d.ts.map +1 -1
- package/dist/product-feeds.js +5 -0
- package/dist/product-feeds.js.map +1 -1
- package/dist/product-scope-model.d.ts +161 -0
- package/dist/product-scope-model.d.ts.map +1 -0
- package/dist/product-scope-model.js +161 -0
- package/dist/product-scope-model.js.map +1 -0
- package/dist/product-scope-overrides.d.ts +0 -103
- package/dist/product-scope-overrides.d.ts.map +1 -1
- package/dist/product-scope-overrides.js +0 -54
- package/dist/product-scope-overrides.js.map +1 -1
- package/dist/product-scoped-values.d.ts +2610 -0
- package/dist/product-scoped-values.d.ts.map +1 -0
- package/dist/product-scoped-values.js +425 -0
- package/dist/product-scoped-values.js.map +1 -0
- package/dist/product-scopes.d.ts +182 -64
- package/dist/product-scopes.d.ts.map +1 -1
- package/dist/product-scopes.js +89 -18
- package/dist/product-scopes.js.map +1 -1
- package/dist/product-tax-rates.d.ts +38 -0
- package/dist/product-tax-rates.d.ts.map +1 -0
- package/dist/product-tax-rates.js +45 -0
- package/dist/product-tax-rates.js.map +1 -0
- package/dist/product-url-keys.d.ts +51 -45
- package/dist/product-url-keys.d.ts.map +1 -1
- package/dist/product-url-keys.js +73 -39
- package/dist/product-url-keys.js.map +1 -1
- package/dist/product-value-resolver.d.ts +37 -60
- package/dist/product-value-resolver.d.ts.map +1 -1
- package/dist/product-value-resolver.js +36 -96
- package/dist/product-value-resolver.js.map +1 -1
- package/dist/projects.d.ts +15 -0
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js +6 -0
- package/dist/projects.js.map +1 -1
- package/dist/promotions.d.ts +10 -10
- package/dist/pwa.d.ts +2 -2
- package/dist/quick-order.d.ts +150 -6
- package/dist/quick-order.d.ts.map +1 -1
- package/dist/quick-order.js +75 -1
- package/dist/quick-order.js.map +1 -1
- package/dist/quote-requests.d.ts +63 -12
- package/dist/quote-requests.d.ts.map +1 -1
- package/dist/quote-requests.js +42 -1
- package/dist/quote-requests.js.map +1 -1
- package/dist/record-references.d.ts.map +1 -1
- package/dist/record-references.js +2 -3
- package/dist/record-references.js.map +1 -1
- package/dist/record-rich-text.d.ts.map +1 -1
- package/dist/record-rich-text.js +2 -1
- package/dist/record-rich-text.js.map +1 -1
- package/dist/returns.d.ts +208 -52
- package/dist/returns.d.ts.map +1 -1
- package/dist/returns.js +139 -26
- package/dist/returns.js.map +1 -1
- package/dist/saved-list-views.d.ts +28 -0
- package/dist/saved-list-views.d.ts.map +1 -1
- package/dist/saved-list-views.js +14 -1
- package/dist/saved-list-views.js.map +1 -1
- package/dist/scoped-write-encoding.d.ts +100 -0
- package/dist/scoped-write-encoding.d.ts.map +1 -0
- package/dist/scoped-write-encoding.js +135 -0
- package/dist/scoped-write-encoding.js.map +1 -0
- package/dist/search.d.ts +18 -16
- package/dist/search.d.ts.map +1 -1
- package/dist/seo.d.ts +81 -28
- package/dist/seo.d.ts.map +1 -1
- package/dist/seo.js +8 -1
- package/dist/seo.js.map +1 -1
- package/dist/settings.d.ts +129 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +36 -0
- package/dist/settings.js.map +1 -1
- package/dist/shopping-lists.d.ts +24 -3
- package/dist/shopping-lists.d.ts.map +1 -1
- package/dist/shopping-lists.js +20 -0
- package/dist/shopping-lists.js.map +1 -1
- package/dist/storefront-cache-tags.d.ts +12 -0
- package/dist/storefront-cache-tags.d.ts.map +1 -1
- package/dist/storefront-cache-tags.js +12 -0
- package/dist/storefront-cache-tags.js.map +1 -1
- package/dist/storefront-value-overrides.d.ts +18 -56
- package/dist/storefront-value-overrides.d.ts.map +1 -1
- package/dist/storefront-value-overrides.js +11 -86
- package/dist/storefront-value-overrides.js.map +1 -1
- package/dist/tasks.d.ts +6 -6
- package/dist/transactional-emails.d.ts +9 -9
- package/package.json +2 -2
- package/dist/scoped-translations.d.ts +0 -48
- package/dist/scoped-translations.d.ts.map +0 -1
- package/dist/scoped-translations.js +0 -78
- package/dist/scoped-translations.js.map +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { isoDateTimeSchema, uuidSchema } from './common.js';
|
|
3
|
+
import { ERROR_CODES } from './errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* Organization roles and organization permissions — the buyer's side of
|
|
6
|
+
* "who may do what" (`specs/170-organization-roles/`).
|
|
7
|
+
*
|
|
8
|
+
* An Organization holds two predefined roles — *Administrator* (every present
|
|
9
|
+
* permission, immutable) and *Member* (editable) — and up to fifty custom ones.
|
|
10
|
+
* Each member holds exactly one. A role is a set of **organization permission**
|
|
11
|
+
* codes (`<module>.<action>`), declared by the module whose buyer action each
|
|
12
|
+
* gates in its manifest's `organizationPermissions` field (`./modules.ts`).
|
|
13
|
+
* The operator vocabulary (`<area>:<action>`, `/admin-roles`) is a different
|
|
14
|
+
* one and the two never meet (FR-020, research R-2).
|
|
15
|
+
*
|
|
16
|
+
* Normative: `specs/170-organization-roles/contracts/organization-permission-port.md`
|
|
17
|
+
* and `contracts/storefront-api.md` §2. They replaced the legacy two-value role
|
|
18
|
+
* enum, removed with its columns by the feature's legacy-removal package
|
|
19
|
+
* (research R-23).
|
|
20
|
+
*/
|
|
21
|
+
// --- Kinds and references ----------------------------------------------------
|
|
22
|
+
export const organizationRoleKindSchema = z.enum(['administrator', 'member', 'custom']);
|
|
23
|
+
/**
|
|
24
|
+
* The role as every response shows it (FR-008, FR-056, FR-073). `name` is the
|
|
25
|
+
* translated label for `administrator` / `member` in the response language and
|
|
26
|
+
* the stored name for `custom`.
|
|
27
|
+
*/
|
|
28
|
+
export const organizationRoleRefSchema = z
|
|
29
|
+
.object({ id: uuidSchema, name: z.string(), kind: organizationRoleKindSchema })
|
|
30
|
+
.strict();
|
|
31
|
+
/**
|
|
32
|
+
* One role on the role-management screens, storefront and Admin UI alike
|
|
33
|
+
* (`contracts/storefront-api.md` §2). `permissions` are the stored grants of
|
|
34
|
+
* **present** codes only — a grant of a switched-off module's code is kept
|
|
35
|
+
* server-side and never round-trips through the editor (FR-025); for the
|
|
36
|
+
* administrator it is every present code. `pendingInvitationCount` counts
|
|
37
|
+
* invitations neither accepted, revoked nor expired (FR-010a).
|
|
38
|
+
*/
|
|
39
|
+
export const organizationRoleViewSchema = z.object({
|
|
40
|
+
id: uuidSchema,
|
|
41
|
+
kind: organizationRoleKindSchema,
|
|
42
|
+
name: z.string(),
|
|
43
|
+
description: z.string().nullable(),
|
|
44
|
+
permissions: z.array(z.string()),
|
|
45
|
+
memberCount: z.number().int().min(0),
|
|
46
|
+
pendingInvitationCount: z.number().int().min(0),
|
|
47
|
+
version: z.number().int().min(1),
|
|
48
|
+
updatedAt: isoDateTimeSchema,
|
|
49
|
+
});
|
|
50
|
+
export const organizationRoleListResponseSchema = z.object({ data: z.array(organizationRoleViewSchema) });
|
|
51
|
+
export const organizationRoleResponseSchema = z.object({ data: organizationRoleViewSchema });
|
|
52
|
+
/** One grantable code, translated in the request language (R-31). */
|
|
53
|
+
export const organizationPermissionCatalogueEntrySchema = z.object({
|
|
54
|
+
code: z.string(),
|
|
55
|
+
label: z.string(),
|
|
56
|
+
description: z.string(),
|
|
57
|
+
memberDefault: z.boolean(),
|
|
58
|
+
});
|
|
59
|
+
/** `GET …/permission-catalogue` — present codes only, grouped by declaring module. */
|
|
60
|
+
export const organizationPermissionCatalogueResponseSchema = z.object({
|
|
61
|
+
data: z.object({
|
|
62
|
+
groups: z.array(z.object({
|
|
63
|
+
moduleId: z.string(),
|
|
64
|
+
moduleLabel: z.string(),
|
|
65
|
+
permissions: z.array(organizationPermissionCatalogueEntrySchema),
|
|
66
|
+
})),
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
/** `GET /api/v1/organizations/mine/role` — the member's own role (FR-058). */
|
|
70
|
+
export const organizationOwnRoleResponseSchema = z.object({
|
|
71
|
+
data: z.object({
|
|
72
|
+
role: organizationRoleRefSchema,
|
|
73
|
+
permissions: z.array(z.object({ code: z.string(), label: z.string(), description: z.string() })),
|
|
74
|
+
}),
|
|
75
|
+
});
|
|
76
|
+
/** `DELETE …/roles/:id` — what moved to the replacement role (FR-024). */
|
|
77
|
+
export const deleteOrganizationRoleResponseSchema = z.object({
|
|
78
|
+
data: z.object({
|
|
79
|
+
reassignedMembers: z.number().int().min(0),
|
|
80
|
+
reassignedInvitations: z.number().int().min(0),
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
// --- Requests -----------------------------------------------------------------
|
|
84
|
+
//
|
|
85
|
+
// Every request schema here is `.strict()`, and that is load-bearing (FR-073,
|
|
86
|
+
// research R-24): Zod's default `.object` strips an unknown key silently, so a
|
|
87
|
+
// client still sending the legacy `role` would be answered as though it had
|
|
88
|
+
// asked for the default role. Strict refuses it with `400 VALIDATION_FAILED`
|
|
89
|
+
// naming the key.
|
|
90
|
+
const roleNameSchema = z.string().trim().min(1).max(80);
|
|
91
|
+
const roleDescriptionSchema = z.string().trim().max(500);
|
|
92
|
+
const permissionCodesSchema = z.array(z.string().min(1));
|
|
93
|
+
/** `POST …/roles` — a custom role. */
|
|
94
|
+
export const createOrganizationRoleRequestSchema = z
|
|
95
|
+
.object({
|
|
96
|
+
name: roleNameSchema,
|
|
97
|
+
description: roleDescriptionSchema.optional(),
|
|
98
|
+
permissions: permissionCodesSchema,
|
|
99
|
+
})
|
|
100
|
+
.strict();
|
|
101
|
+
/**
|
|
102
|
+
* `PATCH …/roles/:id`. `expectedVersion` is the version the editor read
|
|
103
|
+
* (`ORGANIZATION_ROLE_STALE` on mismatch, R-29); `name` and `description` are
|
|
104
|
+
* refused for the *Member* role by the Command, not by the schema.
|
|
105
|
+
*/
|
|
106
|
+
export const updateOrganizationRoleRequestSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
expectedVersion: z.number().int().min(1),
|
|
109
|
+
name: roleNameSchema.optional(),
|
|
110
|
+
description: roleDescriptionSchema.nullable().optional(),
|
|
111
|
+
permissions: permissionCodesSchema.optional(),
|
|
112
|
+
})
|
|
113
|
+
.strict();
|
|
114
|
+
/** `DELETE …/roles/:id`. A held role needs a replacement (FR-024). */
|
|
115
|
+
export const deleteOrganizationRoleRequestSchema = z
|
|
116
|
+
.object({
|
|
117
|
+
expectedVersion: z.number().int().min(1),
|
|
118
|
+
replacementRoleId: uuidSchema.optional(),
|
|
119
|
+
})
|
|
120
|
+
.strict();
|
|
121
|
+
/**
|
|
122
|
+
* `PATCH /api/v1/organizations/mine/members/:id/role` — replaces the legacy
|
|
123
|
+
* `changeMemberRoleRequestSchema` (`{ role }`).
|
|
124
|
+
*/
|
|
125
|
+
export const assignMemberRoleRequestSchema = z.object({ roleId: uuidSchema }).strict();
|
|
126
|
+
/**
|
|
127
|
+
* Inviting a member, on the storefront and in the Admin UI
|
|
128
|
+
* (`POST …/mine/invitations`, `POST /api/v1/admin/organizations/:id/members/invite`)
|
|
129
|
+
* — replaces the legacy `inviteMemberRequestSchema` (`{ email, role? }`). An
|
|
130
|
+
* absent `roleId` is the Organization's *Member* role, resolved server-side.
|
|
131
|
+
*/
|
|
132
|
+
export const inviteMemberToRoleRequestSchema = z
|
|
133
|
+
.object({ email: z.string().email(), roleId: uuidSchema.optional() })
|
|
134
|
+
.strict();
|
|
135
|
+
/**
|
|
136
|
+
* Platform admin — `POST /api/v1/admin/organizations/:id/members` (direct
|
|
137
|
+
* create). Replaces the legacy `adminDirectMemberRequestSchema`'s `role?`.
|
|
138
|
+
*/
|
|
139
|
+
export const adminDirectMemberToRoleRequestSchema = z
|
|
140
|
+
.object({
|
|
141
|
+
email: z.string().email(),
|
|
142
|
+
firstName: z.string().min(1).max(120),
|
|
143
|
+
lastName: z.string().min(1).max(120),
|
|
144
|
+
password: z.string().min(12).max(256),
|
|
145
|
+
roleId: uuidSchema.optional(),
|
|
146
|
+
})
|
|
147
|
+
.strict();
|
|
148
|
+
/**
|
|
149
|
+
* Platform admin — `PATCH /api/v1/admin/organizations/:id/members/:customerAccountId/role`.
|
|
150
|
+
* Replaces the legacy `adminPatchMemberRoleRequestSchema` (`{ role, expectedUpdatedAt? }`).
|
|
151
|
+
*/
|
|
152
|
+
export const adminAssignMemberRoleRequestSchema = z
|
|
153
|
+
.object({ roleId: uuidSchema, expectedUpdatedAt: z.string().optional() })
|
|
154
|
+
.strict();
|
|
155
|
+
// --- The route guard -------------------------------------------------------------
|
|
156
|
+
/**
|
|
157
|
+
* The refusal {@link organizationPermissionPreHandler} raises for a request
|
|
158
|
+
* that carries no customer: `401 UNAUTHORIZED`, the answer `requireCustomer`
|
|
159
|
+
* gives.
|
|
160
|
+
*
|
|
161
|
+
* It is a class of this package rather than the platform's `HttpError`
|
|
162
|
+
* because the guard is a plain function here and this package depends on
|
|
163
|
+
* nothing but `zod` — it cannot construct the platform's error. The platform's
|
|
164
|
+
* error envelope renders it exactly as it renders `requireCustomer`'s refusal.
|
|
165
|
+
* The guard is declared **after** `requireCustomer`, so in a correctly
|
|
166
|
+
* declared route this is a second line and never the first.
|
|
167
|
+
*/
|
|
168
|
+
export class CustomerSessionRequiredError extends Error {
|
|
169
|
+
statusCode = 401;
|
|
170
|
+
code = ERROR_CODES.UNAUTHORIZED;
|
|
171
|
+
constructor() {
|
|
172
|
+
super('Customer session required.');
|
|
173
|
+
this.name = 'CustomerSessionRequiredError';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The route guard every gating module declares (research R-20, R-35):
|
|
178
|
+
*
|
|
179
|
+
* ```ts
|
|
180
|
+
* preHandler: [requireCustomer, organizationPermissionPreHandler(() => permissions, 'carts.create')]
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* A plain function — no Fastify import — so it lives beside the port it calls.
|
|
184
|
+
* `getPort` is a thunk resolved on **every** request, never at registration:
|
|
185
|
+
* a captured port is the third fail-open shape of `module-composition.md` item
|
|
186
|
+
* 4a. A customer actor — impersonation included — is judged by `assert` with
|
|
187
|
+
* the subject built from the actor and the response language; the port's
|
|
188
|
+
* refusal propagates unchanged. Composite actions are two guards, never a
|
|
189
|
+
* combined code; the refusal names the first missing one.
|
|
190
|
+
*/
|
|
191
|
+
export function organizationPermissionPreHandler(getPort, code, options = {}) {
|
|
192
|
+
const guests = options.guests ?? 'refuse';
|
|
193
|
+
return async (request) => {
|
|
194
|
+
const actor = request.actor;
|
|
195
|
+
if (actor.kind !== 'customer') {
|
|
196
|
+
if (guests === 'pass')
|
|
197
|
+
return;
|
|
198
|
+
throw new CustomerSessionRequiredError();
|
|
199
|
+
}
|
|
200
|
+
const subject = {
|
|
201
|
+
customerAccountId: actor.customerAccountId,
|
|
202
|
+
// `''` is what the auth hook stamps when no resolver is wired; the port
|
|
203
|
+
// finds no role in it and fails closed.
|
|
204
|
+
organizationId: actor.organizationId ?? '',
|
|
205
|
+
organizationRoleId: actor.organizationRoleId ?? null,
|
|
206
|
+
};
|
|
207
|
+
const language = request.responseLanguage ? await request.responseLanguage() : undefined;
|
|
208
|
+
await getPort().assert(subject, code, language === undefined ? {} : { language });
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=organization-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-roles.js","sourceRoot":"","sources":["../src/organization-roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;GAgBG;AAEH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGxF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC,EAAE,EAAE,EAAE,U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8B,CAAC;IAC7C,CAAC;CACF;AAoBD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gCAAgC,CAC9C,OAAyC,EACzC,IAAY,EACZ,UAA8C,EAAE;IAEhD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC;IAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC9B,IAAI,MAAM,KAAK,MAAM;gBAAE,OAAO;YAC9B,MAAM,IAAI,4BAA4B,EAAE,CAAC;QAC3C,CAAC;QACD,MAAM,OAAO,GAAkC;YAC7C,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,wEAAwE;YACxE,wCAAwC;YACxC,cAAc,EAAE,KAAK,CAAC,cAAc,IAAI,EAAE;YAC1C,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,IAAI,IAAI;SACrD,CAAC;QACF,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACzF,MAAM,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/organizations.d.ts
CHANGED
|
@@ -45,6 +45,19 @@ export declare const creditInheritanceModeSchema: z.ZodEnum<{
|
|
|
45
45
|
independent_default: "independent_default";
|
|
46
46
|
}>;
|
|
47
47
|
export type CreditInheritanceMode = z.infer<typeof creditInheritanceModeSchema>;
|
|
48
|
+
/**
|
|
49
|
+
* The codes a redacted `organization` audit row keeps (issue #844).
|
|
50
|
+
*
|
|
51
|
+
* Owner: `organizations`; **codes only** — see
|
|
52
|
+
* `CUSTOMER_ACCOUNT_AUDIT_KEEP_KEYS` for the rule they extend. This module's
|
|
53
|
+
* snapshots record codes under `provider` and `outcome` (a tax-id validation)
|
|
54
|
+
* and `creditInheritanceMode`; `blockSource` and `countryCode` are kept
|
|
55
|
+
* wherever a writer records them, as they are on the account and the address.
|
|
56
|
+
* `orderConfirmationEmailCount` is the count the `organization.anonymized` row
|
|
57
|
+
* records instead of the addresses: the retention sweep redacts after that row
|
|
58
|
+
* is written, and must leave it as its owner wrote it (issue #844).
|
|
59
|
+
*/
|
|
60
|
+
export declare const ORGANIZATION_AUDIT_KEEP_KEYS: readonly string[];
|
|
48
61
|
export declare const addressKindSchema: z.ZodEnum<{
|
|
49
62
|
delivery: "delivery";
|
|
50
63
|
billing: "billing";
|
|
@@ -170,10 +183,16 @@ export declare const customerAccountSchema: z.ZodObject<{
|
|
|
170
183
|
email: z.ZodString;
|
|
171
184
|
firstName: z.ZodString;
|
|
172
185
|
lastName: z.ZodString;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
186
|
+
organizationRole: z.ZodObject<{
|
|
187
|
+
id: z.ZodString;
|
|
188
|
+
name: z.ZodString;
|
|
189
|
+
kind: z.ZodEnum<{
|
|
190
|
+
custom: "custom";
|
|
191
|
+
administrator: "administrator";
|
|
192
|
+
member: "member";
|
|
193
|
+
}>;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
177
196
|
emailVerifiedAt: z.ZodNullable<z.ZodString>;
|
|
178
197
|
twoFactorEnabled: z.ZodBoolean;
|
|
179
198
|
createdAt: z.ZodString;
|
|
@@ -219,6 +238,7 @@ export declare const registerOrganizationRequestSchema: z.ZodObject<{
|
|
|
219
238
|
lastName: z.ZodString;
|
|
220
239
|
}, z.core.$strip>;
|
|
221
240
|
acceptedTermsVersion: z.ZodString;
|
|
241
|
+
registryLookupId: z.ZodOptional<z.ZodString>;
|
|
222
242
|
}, z.core.$strip>;
|
|
223
243
|
export type RegisterOrganizationRequest = z.infer<typeof registerOrganizationRequestSchema>;
|
|
224
244
|
export declare const emailVerificationRequestSchema: z.ZodObject<{
|
|
@@ -250,6 +270,7 @@ export declare const cartMergeOutcomeSchema: z.ZodObject<{
|
|
|
250
270
|
merged: "merged";
|
|
251
271
|
noop_empty: "noop_empty";
|
|
252
272
|
noop_no_anon: "noop_no_anon";
|
|
273
|
+
skipped_permission: "skipped_permission";
|
|
253
274
|
}>;
|
|
254
275
|
movedLineCount: z.ZodNumber;
|
|
255
276
|
summedLineCount: z.ZodNumber;
|
|
@@ -283,10 +304,16 @@ export declare const customerLoginResponseSchema: z.ZodObject<{
|
|
|
283
304
|
id: z.ZodString;
|
|
284
305
|
email: z.ZodString;
|
|
285
306
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
307
|
+
organizationRole: z.ZodObject<{
|
|
308
|
+
id: z.ZodString;
|
|
309
|
+
name: z.ZodString;
|
|
310
|
+
kind: z.ZodEnum<{
|
|
311
|
+
custom: "custom";
|
|
312
|
+
administrator: "administrator";
|
|
313
|
+
member: "member";
|
|
314
|
+
}>;
|
|
315
|
+
}, z.core.$strict>;
|
|
316
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
290
317
|
twoFactorEnabled: z.ZodBoolean;
|
|
291
318
|
}, z.core.$strip>;
|
|
292
319
|
cartMerge: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -332,24 +359,11 @@ export declare const updateAddressRequestSchema: z.ZodObject<{
|
|
|
332
359
|
isDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
333
360
|
}, z.core.$strip>;
|
|
334
361
|
export type UpdateAddressRequest = z.infer<typeof updateAddressRequestSchema>;
|
|
335
|
-
export declare const inviteMemberRequestSchema: z.ZodObject<{
|
|
336
|
-
email: z.ZodString;
|
|
337
|
-
role: z.ZodOptional<z.ZodEnum<{
|
|
338
|
-
organization_admin: "organization_admin";
|
|
339
|
-
regular_user: "regular_user";
|
|
340
|
-
}>>;
|
|
341
|
-
}, z.core.$strip>;
|
|
342
362
|
export declare const acceptInvitationRequestSchema: z.ZodObject<{
|
|
343
363
|
password: z.ZodString;
|
|
344
364
|
firstName: z.ZodString;
|
|
345
365
|
lastName: z.ZodString;
|
|
346
366
|
}, z.core.$strip>;
|
|
347
|
-
export declare const changeMemberRoleRequestSchema: z.ZodObject<{
|
|
348
|
-
role: z.ZodEnum<{
|
|
349
|
-
organization_admin: "organization_admin";
|
|
350
|
-
regular_user: "regular_user";
|
|
351
|
-
}>;
|
|
352
|
-
}, z.core.$strip>;
|
|
353
367
|
/** Platform admin — PATCH `/admin/organizations/:id` */
|
|
354
368
|
export declare const adminPatchOrganizationRequestSchema: z.ZodObject<{
|
|
355
369
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -380,25 +394,6 @@ export declare const adminPatchOrganizationRequestSchema: z.ZodObject<{
|
|
|
380
394
|
export declare const adminRecoverOrgAccessRequestSchema: z.ZodObject<{
|
|
381
395
|
promoteCustomerAccountId: z.ZodString;
|
|
382
396
|
}, z.core.$strip>;
|
|
383
|
-
/** Platform admin — POST `/admin/organizations/:id/members` (direct create) */
|
|
384
|
-
export declare const adminDirectMemberRequestSchema: z.ZodObject<{
|
|
385
|
-
email: z.ZodString;
|
|
386
|
-
firstName: z.ZodString;
|
|
387
|
-
lastName: z.ZodString;
|
|
388
|
-
password: z.ZodString;
|
|
389
|
-
role: z.ZodOptional<z.ZodEnum<{
|
|
390
|
-
organization_admin: "organization_admin";
|
|
391
|
-
regular_user: "regular_user";
|
|
392
|
-
}>>;
|
|
393
|
-
}, z.core.$strip>;
|
|
394
|
-
/** Platform admin — PATCH member role */
|
|
395
|
-
export declare const adminPatchMemberRoleRequestSchema: z.ZodObject<{
|
|
396
|
-
role: z.ZodEnum<{
|
|
397
|
-
organization_admin: "organization_admin";
|
|
398
|
-
regular_user: "regular_user";
|
|
399
|
-
}>;
|
|
400
|
-
expectedUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
401
|
-
}, z.core.$strip>;
|
|
402
397
|
/**
|
|
403
398
|
* Feature 056 (T032) — Platform admin — PATCH member roll-up capability.
|
|
404
399
|
* When enabled, this customer login sees/acts across its organization's subtree.
|
|
@@ -465,10 +460,16 @@ export declare const registerOrganizationResponseSchema: z.ZodObject<{
|
|
|
465
460
|
email: z.ZodString;
|
|
466
461
|
firstName: z.ZodString;
|
|
467
462
|
lastName: z.ZodString;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
463
|
+
organizationRole: z.ZodObject<{
|
|
464
|
+
id: z.ZodString;
|
|
465
|
+
name: z.ZodString;
|
|
466
|
+
kind: z.ZodEnum<{
|
|
467
|
+
custom: "custom";
|
|
468
|
+
administrator: "administrator";
|
|
469
|
+
member: "member";
|
|
470
|
+
}>;
|
|
471
|
+
}, z.core.$strict>;
|
|
472
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
472
473
|
emailVerifiedAt: z.ZodNullable<z.ZodString>;
|
|
473
474
|
twoFactorEnabled: z.ZodBoolean;
|
|
474
475
|
createdAt: z.ZodString;
|
|
@@ -553,7 +554,8 @@ export declare const salesRepOrganizationSchema: z.ZodObject<{
|
|
|
553
554
|
assignedAt: z.ZodString;
|
|
554
555
|
}, z.core.$strip>;
|
|
555
556
|
export type SalesRepOrganization = z.infer<typeof salesRepOrganizationSchema>;
|
|
556
|
-
|
|
557
|
+
/** `gus_pl` — feature 173: the GUS REGON registry, written by a registration-time lookup. */
|
|
558
|
+
export type VatValidationProvider = 'vies' | 'mf_pl' | 'format_only' | 'gus_pl';
|
|
557
559
|
export type VatValidationOutcome = 'validated' | 'failed' | 'deferred' | 'unverified';
|
|
558
560
|
/** The JSONB snapshot the organisation's registered address is stored as. */
|
|
559
561
|
export interface OrganizationRegisteredAddress {
|
|
@@ -588,7 +590,6 @@ export interface OrganizationRecord {
|
|
|
588
590
|
rejectedAt: Date | null;
|
|
589
591
|
approvedAt: Date | null;
|
|
590
592
|
approvedByAdminUserId: string | null;
|
|
591
|
-
requiresCartApproval: boolean;
|
|
592
593
|
fulfilmentStrategy: FulfilmentStrategy | null;
|
|
593
594
|
fulfilmentStrategyWarehouseOrder: string[] | null;
|
|
594
595
|
parentId: string | null;
|
|
@@ -641,6 +642,25 @@ export interface OrganizationDetailsPort {
|
|
|
641
642
|
/** The same search, ids only — for the order list's organisation filter. */
|
|
642
643
|
searchIdsByName(query: string): Promise<string[]>;
|
|
643
644
|
}
|
|
645
|
+
/**
|
|
646
|
+
* The tax id a reader may print or hand out for an Organization: a company's,
|
|
647
|
+
* never a personal (B2C) Organization's, whose `taxId` is an internal 32-hex
|
|
648
|
+
* placeholder derived from the account id (issue #767). `null` — not an empty
|
|
649
|
+
* string — when there is nothing to show, so every renderer drops its tax-id
|
|
650
|
+
* line rather than printing a label with no value.
|
|
651
|
+
*
|
|
652
|
+
* Published as a **function, not a port**, for the reason
|
|
653
|
+
* {@link normalizeOrganizationName} is: it is pure over its argument. Every
|
|
654
|
+
* module that prints an {@link OrganizationRecord}'s tax id asks it — the quote
|
|
655
|
+
* request document, the admin order and quote request panels, the price-book
|
|
656
|
+
* and push audience pickers, and the storefront's checkout — so the rule has
|
|
657
|
+
* one home.
|
|
658
|
+
*/
|
|
659
|
+
export declare function organizationCompanyTaxId(organization: {
|
|
660
|
+
/** Absent reads as a company, as a session payload without the flag does. */
|
|
661
|
+
readonly isPersonal?: boolean | undefined;
|
|
662
|
+
readonly taxId: string;
|
|
663
|
+
}): string | null;
|
|
644
664
|
/**
|
|
645
665
|
* Diacritic-insensitive normalisation for the organisation's `name_search`
|
|
646
666
|
* column and for any query string matched against it.
|
|
@@ -713,39 +733,6 @@ export interface OrganizationCreditOwner {
|
|
|
713
733
|
export interface OrganizationInheritancePort {
|
|
714
734
|
creditOwner(organizationId: string): Promise<OrganizationCreditOwner>;
|
|
715
735
|
}
|
|
716
|
-
/** What a cart-approval-policy write answers with. */
|
|
717
|
-
export interface CartApprovalPolicyWriteResult {
|
|
718
|
-
readonly organization: OrganizationRecord;
|
|
719
|
-
/**
|
|
720
|
-
* `false` when the row already carried the requested value, so nothing was
|
|
721
|
-
* written and nothing was audited. It is part of the return type rather than
|
|
722
|
-
* something the caller re-derives from a read, because the caller's cascade
|
|
723
|
-
* hangs off it: `carts` resets its pending and approved carts when — and only
|
|
724
|
-
* when — the policy actually moved to `false`.
|
|
725
|
-
*/
|
|
726
|
-
readonly changed: boolean;
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* Container name: `organizationCartApprovalWritePort`. Owner: `organizations`.
|
|
730
|
-
*
|
|
731
|
-
* The per-organisation "an Org Admin must approve a cart before checkout"
|
|
732
|
-
* policy (feature 027 US4). `carts` drives both surfaces that flip it — the
|
|
733
|
-
* platform-admin route and the Org-Admin self-service one — but the column is
|
|
734
|
-
* this module's, so the operation is (issue #175, D-78 step 1).
|
|
735
|
-
*
|
|
736
|
-
* The write runs through `CommandBus.run`, so it carries the audit row it had
|
|
737
|
-
* never had while `carts` was writing the column directly, with the actor
|
|
738
|
-
* derived from the caller's ambient context (Constitution XIII). The cart
|
|
739
|
-
* cascade that follows a switch-off stays with `carts`: those are its rows, and
|
|
740
|
-
* they are audited in its own per-cart trail.
|
|
741
|
-
*
|
|
742
|
-
* This module is non-deactivatable, so the gate the port registration applies
|
|
743
|
-
* cannot be reached; the registration is a `providePort` anyway, for the reason
|
|
744
|
-
* its siblings give.
|
|
745
|
-
*/
|
|
746
|
-
export interface OrganizationCartApprovalWritePort {
|
|
747
|
-
setCartApprovalPolicy(organizationId: string, requiresCartApproval: boolean): Promise<CartApprovalPolicyWriteResult>;
|
|
748
|
-
}
|
|
749
736
|
/** The three allow-list kinds an organisation can restrict. */
|
|
750
737
|
export type OrganizationAllowListKind = 'paymentMethodIds' | 'deliveryMethodIds' | 'warehouseIds';
|
|
751
738
|
/**
|
|
@@ -767,6 +754,15 @@ export type OrganizationAllowListKind = 'paymentMethodIds' | 'deliveryMethodIds'
|
|
|
767
754
|
export interface OrganizationRestrictionPort {
|
|
768
755
|
allowedIdsFor(organizationId: string, kind: OrganizationAllowListKind): Promise<string[] | null>;
|
|
769
756
|
}
|
|
757
|
+
/**
|
|
758
|
+
* A personal organisation as {@link PersonalOrganizationPort.provisionPersonalOrganization}
|
|
759
|
+
* answers it: the record, and the id of its *Administrator* role — the role
|
|
760
|
+
* its single member holds (`specs/170-organization-roles/`, owner ruling PR-3,
|
|
761
|
+
* research R-34), which a caller moving the account there writes with it.
|
|
762
|
+
*/
|
|
763
|
+
export interface ProvisionedPersonalOrganizationRecord extends OrganizationRecord {
|
|
764
|
+
administratorRoleId: string;
|
|
765
|
+
}
|
|
770
766
|
/**
|
|
771
767
|
* Container name: `personalOrganizationPort`. Owner: `organizations`.
|
|
772
768
|
*
|
|
@@ -809,24 +805,62 @@ export interface PersonalOrganizationPort {
|
|
|
809
805
|
* Idempotent: the personal organisation's `taxId` is derived from the account
|
|
810
806
|
* id, so a second call re-finds the row rather than creating a second one.
|
|
811
807
|
*/
|
|
812
|
-
provisionPersonalOrganization(customerAccountId: string): Promise<
|
|
808
|
+
provisionPersonalOrganization(customerAccountId: string): Promise<ProvisionedPersonalOrganizationRecord>;
|
|
813
809
|
/**
|
|
814
810
|
* Feature 051, the other end of the same rule — the retention sweep's
|
|
815
811
|
* cascade. Once the single member of a personal organisation has been
|
|
816
|
-
*
|
|
812
|
+
* soft-deleted, the organisation is left with no live member and its name is
|
|
817
813
|
* derived from that person's name, so it is scrubbed and soft-deleted too.
|
|
818
814
|
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
*
|
|
815
|
+
* **Convergent** (issue #800). The sweep calls this *before* it anonymises
|
|
816
|
+
* the account, and calls it again on the next tick if anything after it
|
|
817
|
+
* failed. It writes only what part of the scrub is still missing (the name,
|
|
818
|
+
* the registered address, the legal name, the order-confirmation e-mails,
|
|
819
|
+
* every custom field value, the block and rejection reasons (issue #843:
|
|
820
|
+
* set to `null`, while the status and its dates stay), `deletedAt` — an
|
|
821
|
+
* existing `deletedAt` is kept),
|
|
822
|
+
* in one transaction with its audit row, and records nothing when nothing
|
|
823
|
+
* was missing. The audit row names none of the erased data (issue #802).
|
|
824
|
+
* It answers the organisation **whether or not it wrote anything**,
|
|
825
|
+
* so a repeat call still tells the caller which saved addresses to clear.
|
|
825
826
|
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
827
|
+
* Answers `null`, and writes nothing, only where the cascade does not apply:
|
|
828
|
+
* an org-less account, an organisation that is not personal, and one that
|
|
829
|
+
* still has a live member. That is why it takes the **account** id rather
|
|
830
|
+
* than the organisation's — the caller (`customers`' anonymisation sweep)
|
|
831
|
+
* knows which customer it is scrubbing and must not be the one deciding
|
|
832
|
+
* whether the organisation qualifies.
|
|
828
833
|
*/
|
|
829
834
|
anonymizeIfOrphaned(customerAccountId: string): Promise<OrganizationRecord | null>;
|
|
835
|
+
/**
|
|
836
|
+
* Issue #923 — the ids of the personal organisations a scrub has reached
|
|
837
|
+
* (they carry its name) that do not yet hold all of the **current** scrub:
|
|
838
|
+
* one an earlier release scrubbed before the rule grew, or one a crash left
|
|
839
|
+
* half-written. The retention sweep runs each one's anonymised member
|
|
840
|
+
* through the cascade again, and {@link anonymizeIfOrphaned} writes what is
|
|
841
|
+
* missing, so a field added to the scrub reaches every earlier subject on
|
|
842
|
+
* the next run with no backfill.
|
|
843
|
+
*
|
|
844
|
+
* The selection is free of any retention cutoff: a subject already
|
|
845
|
+
* anonymised is finished whatever the window reads today. It agrees field by
|
|
846
|
+
* field with the owner's own "fully scrubbed" test, which stays the
|
|
847
|
+
* in-transaction re-check; a live organisation that merely carries the name
|
|
848
|
+
* may be listed, and is left alone because it still has a live member.
|
|
849
|
+
*
|
|
850
|
+
* Reads only the owner's rows; writes nothing. Unbounded, like
|
|
851
|
+
* `CustomerAccountLifecycleWritePort.listDueForAnonymization`: in steady
|
|
852
|
+
* state it answers an empty list.
|
|
853
|
+
*/
|
|
854
|
+
listIncompletelyScrubbed(): Promise<string[]>;
|
|
855
|
+
/**
|
|
856
|
+
* Whether {@link listIncompletelyScrubbed} would list anything — **yes or
|
|
857
|
+
* no, and nothing else**. The retention sweep's scheduled tick asks it with
|
|
858
|
+
* no tenant context, before it enters the system scope, beside
|
|
859
|
+
* `CustomerAccountLifecycleWritePort.hasDueForAnonymization`, so that a tick
|
|
860
|
+
* with organisation-side residue to finish is not taken for an idle one. It
|
|
861
|
+
* is the list's own row source; no id, row or count leaves it.
|
|
862
|
+
*/
|
|
863
|
+
hasIncompletelyScrubbed(): Promise<boolean>;
|
|
830
864
|
}
|
|
831
865
|
/** One sales-rep ↔ organisation assignment row. */
|
|
832
866
|
export interface SalesRepAssignmentRow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../src/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../src/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMnF;;;;GAIG;AAIH;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;EAKnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,eAAe;;;;EAAwD,CAAC;AACrF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B;;;EAAi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