@tearleads/client-sdk 0.1.88 → 0.1.90

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.
Files changed (73) hide show
  1. package/client/index.d.ts +1 -1
  2. package/client/index.js.map +1 -1
  3. package/client/organizations/index.d.ts +1 -1
  4. package/client/organizations/index.js +9 -5
  5. package/client/organizations/index.js.map +1 -1
  6. package/client/organizations/organizationMemberships.d.ts +12 -1
  7. package/client/organizations/organizationMemberships.js +36 -2
  8. package/client/organizations/organizationMemberships.js.map +1 -1
  9. package/client/organizations/organizationReadModels.d.ts +7 -1
  10. package/client/organizations/organizationReadModels.js +15 -6
  11. package/client/organizations/organizationReadModels.js.map +1 -1
  12. package/data/persistence/organizations/organizationReadModelPersistence.js +14 -0
  13. package/data/persistence/organizations/organizationReadModelPersistence.js.map +1 -1
  14. package/data/persistence/organizations/organizationReadModelProjection.js +12 -0
  15. package/data/persistence/organizations/organizationReadModelProjection.js.map +1 -1
  16. package/data/sqlite/schema/index.d.ts +19 -0
  17. package/data/sqlite/schema/organizationReadModelSchema.js +2 -0
  18. package/data/sqlite/schema/organizationReadModelSchema.js.map +1 -1
  19. package/data/sqlite/schema/organizationReadModelTableRegistry.d.ts +19 -0
  20. package/index.d.ts +1 -1
  21. package/index.js.map +1 -1
  22. package/internal/api-client/ApiClient.d.ts +10 -0
  23. package/internal/api-client/ApiClient.js +8 -2
  24. package/internal/api-client/ApiClient.js.map +1 -1
  25. package/internal/api-client/routes/organizations/memberships.js +20 -1
  26. package/internal/api-client/routes/organizations/memberships.js.map +1 -1
  27. package/internal/crypto/index.d.ts +1 -0
  28. package/internal/crypto/index.js +1 -0
  29. package/internal/crypto/index.js.map +1 -1
  30. package/internal/crypto/organizationLeaveRequest.d.ts +13 -0
  31. package/internal/crypto/organizationLeaveRequest.js +39 -0
  32. package/internal/crypto/organizationLeaveRequest.js.map +1 -0
  33. package/internal/validators/operation/index.d.ts +1 -1
  34. package/internal/validators/operation/index.js +1 -1
  35. package/internal/validators/operation/index.js.map +1 -1
  36. package/internal/validators/operation/organizationMemberships.d.ts +263 -0
  37. package/internal/validators/operation/organizationMemberships.js +42 -0
  38. package/internal/validators/operation/organizationMemberships.js.map +1 -1
  39. package/internal/validators/operation/organizations.d.ts +48 -0
  40. package/internal/validators/operation/registry.d.ts +3 -1
  41. package/internal/validators/operation/registry.js +3 -1
  42. package/internal/validators/operation/registry.js.map +1 -1
  43. package/internal/validators/operation/root.d.ts +8 -0
  44. package/internal/validators/operation/rootOrganizations.d.ts +44 -0
  45. package/internal/validators/response/organization.d.ts +82 -0
  46. package/internal/validators/response/organization.js +6 -0
  47. package/internal/validators/response/organization.js.map +1 -1
  48. package/internal/validators/response/organizationMembership.d.ts +12 -2
  49. package/internal/validators/response/organizationMembership.js +5 -2
  50. package/internal/validators/response/organizationMembership.js.map +1 -1
  51. package/internal/validators/response/organizationReadModel.d.ts +60 -0
  52. package/internal/validators/response/root.d.ts +24 -0
  53. package/internal/validators/response/root.js +4 -0
  54. package/internal/validators/response/root.js.map +1 -1
  55. package/internal/validators/response/rootOrganizations.d.ts +52 -0
  56. package/internal/validators/response/rootOrganizations.js +13 -0
  57. package/internal/validators/response/rootOrganizations.js.map +1 -1
  58. package/internal/validators/util/index.d.ts +1 -0
  59. package/internal/validators/util/index.js +1 -0
  60. package/internal/validators/util/index.js.map +1 -1
  61. package/internal/validators/util/organizationLeaveRequest.d.ts +15 -0
  62. package/internal/validators/util/organizationLeaveRequest.js +22 -0
  63. package/internal/validators/util/organizationLeaveRequest.js.map +1 -0
  64. package/package.json +1 -1
  65. package/workflows/organizations/index.d.ts +2 -0
  66. package/workflows/organizations/index.js +2 -0
  67. package/workflows/organizations/index.js.map +1 -1
  68. package/workflows/organizations/memberships/leaveRequest.d.ts +31 -0
  69. package/workflows/organizations/memberships/leaveRequest.js +20 -0
  70. package/workflows/organizations/memberships/leaveRequest.js.map +1 -0
  71. package/workflows/organizations/memberships/leaveRequestVerification.d.ts +15 -0
  72. package/workflows/organizations/memberships/leaveRequestVerification.js +46 -0
  73. package/workflows/organizations/memberships/leaveRequestVerification.js.map +1 -0
@@ -21,9 +21,21 @@ const RootOrganizationBillingResponseSchema = loosePlainObject({
21
21
  providerProductId: z.string().nullable(),
22
22
  providerTransactionId: z.string().nullable(),
23
23
  entitlementId: z.string().nullable(),
24
+ purgeStartedAt: z.string().nullable(),
24
25
  createdAt: z.string(),
25
26
  updatedAt: z.string(),
26
27
  });
28
+ /** Persisted group bindings plus roster and seat counts; no names or content. */
29
+ const RootOrganizationOverviewResponseSchema = loosePlainObject({
30
+ adminGroupId: nonEmptyStringSchema,
31
+ memberGroupId: nonEmptyStringSchema,
32
+ activeMemberCount: nonNegativeIntegerSchema,
33
+ disabledMemberCount: nonNegativeIntegerSchema,
34
+ /** Active members who paused the organization's sync to their devices. */
35
+ syncPausedMemberCount: nonNegativeIntegerSchema,
36
+ /** Unreleased billable-seat assignments, the billing panel's assigned seats. */
37
+ openSeatAssignmentCount: nonNegativeIntegerSchema,
38
+ });
27
39
  const RootOrganizationStripeResponseSchema = loosePlainObject({
28
40
  customerId: z.string().nullable(),
29
41
  subscriptionId: z.string().nullable(),
@@ -41,6 +53,7 @@ const RootOrganizationStripeResponseSchema = loosePlainObject({
41
53
  });
42
54
  export const RootOrganizationDetailResponseSchema = loosePlainObject({
43
55
  organization: RootOrganizationSummaryResponseSchema,
56
+ overview: RootOrganizationOverviewResponseSchema,
44
57
  billing: RootOrganizationBillingResponseSchema.nullable(),
45
58
  stripe: RootOrganizationStripeResponseSchema.nullable(),
46
59
  /** The 50 most recent merged durable billing events. */
@@ -1 +1 @@
1
- {"version":3,"file":"rootOrganizations.js","sourceRoot":"","sources":["rootOrganizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,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AgB,CAAC;IAChE,aAAa,EAAE,WAAW,CACxB,gBAAgB,CAAC;QACf,YAAY,EAAE,qCAAqC;QACnD,SAAS,EAAE,mCAAmC;KAC/C,CAAC,CACH;IACD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyStringSchema,\n nonNegativeIntegerSchema,\n} from \"../schema\";\nimport { OrganizationBillingStatusSchema } from \"./organizationBilling\";\nimport { OrganizationBillingHistoryEntrySchema } from \"./organizationBillingHistory\";\nimport { OrganizationDataUsageResponseSchema } from \"./organizationDataUsage\";\nimport {\n RootIdentitySummaryResponseSchema,\n RootRosterSchema,\n rootOrganizationBillingShape,\n} from \"./root\";\n\nexport const RootOrganizationSummaryResponseSchema = loosePlainObject({\n organizationId: nonEmptyStringSchema,\n createdAt: z.string(),\n billingStatus: OrganizationBillingStatusSchema.nullable(),\n});\nexport type RootOrganizationSummaryResponse = z.infer<\n typeof RootOrganizationSummaryResponseSchema\n>;\n\nexport const RootOrganizationsResponseSchema = loosePlainObject({\n organizations: arraySchema(RootOrganizationSummaryResponseSchema),\n nextCursor: z.string().nullable(),\n});\nexport type RootOrganizationsResponse = z.infer<\n typeof RootOrganizationsResponseSchema\n>;\n\nconst RootOrganizationBillingResponseSchema = loosePlainObject({\n ...rootOrganizationBillingShape,\n currentPeriodStartsAt: z.string().nullable(),\n providerCustomerId: z.string().nullable(),\n providerSubscriptionId: z.string().nullable(),\n providerProductId: z.string().nullable(),\n providerTransactionId: z.string().nullable(),\n entitlementId: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nconst RootOrganizationStripeResponseSchema = loosePlainObject({\n customerId: z.string().nullable(),\n subscriptionId: z.string().nullable(),\n subscriptionItemId: z.string().nullable(),\n priceId: z.string().nullable(),\n lastInvoiceId: z.string().nullable(),\n desiredPaidCapacity: nonNegativeIntegerSchema,\n desiredRenewalQuantity: nonNegativeIntegerSchema,\n appliedPaidCapacity: nonNegativeIntegerSchema,\n observedQuantity: nonNegativeIntegerSchema.nullable(),\n lastSyncedAt: z.string().nullable(),\n nextAttemptAt: z.string().nullable(),\n attemptCount: nonNegativeIntegerSchema,\n lastError: z.string().nullable(),\n});\n\nexport const RootOrganizationDetailResponseSchema = loosePlainObject({\n organization: RootOrganizationSummaryResponseSchema,\n billing: RootOrganizationBillingResponseSchema.nullable(),\n stripe: RootOrganizationStripeResponseSchema.nullable(),\n /** The 50 most recent merged durable billing events. */\n history: arraySchema(OrganizationBillingHistoryEntrySchema),\n});\nexport type RootOrganizationDetailResponse = z.infer<\n typeof RootOrganizationDetailResponseSchema\n>;\n\nexport const RootOrganizationIdentityResponseSchema = loosePlainObject({\n identity: RootIdentitySummaryResponseSchema,\n roster: RootRosterSchema,\n});\nexport type RootOrganizationIdentityResponse = z.infer<\n typeof RootOrganizationIdentityResponseSchema\n>;\nexport const RootOrganizationIdentitiesResponseSchema = loosePlainObject({\n identities: arraySchema(RootOrganizationIdentityResponseSchema),\n nextCursor: z.string().nullable(),\n});\nexport type RootOrganizationIdentitiesResponse = z.infer<\n typeof RootOrganizationIdentitiesResponseSchema\n>;\n\nexport const RootDataUsageReportResponseSchema = loosePlainObject({\n organizations: arraySchema(\n loosePlainObject({\n organization: RootOrganizationSummaryResponseSchema,\n dataUsage: OrganizationDataUsageResponseSchema,\n }),\n ),\n nextCursor: z.string().nullable(),\n});\nexport type RootDataUsageReportResponse = z.infer<\n typeof RootDataUsageReportResponseSchema\n>;\n"]}
1
+ {"version":3,"file":"rootOrganizations.js","sourceRoot":"","sources":["rootOrganizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,+BAA+B,EAAE,MAA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,CAAC,MAAM,sCAAsC,GAAG,gBAAgB,CAAC;IACrE,QAAQ,EAAE,iCAAiC;IAC3C,MAAM,EAAE,gBAAgB;CACzB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,wCAAwC,GAAG,gBAAgB,CAAC;IACvE,UAAU,EAAE,WAAW,CAAC,sCAAsC,CAAC;IAC/D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,iCAAiC,GAAG,gBAAgB,CAAC;IAChE,aAAa,EAAE,WAAW,CACxB,gBAAgB,CAAC;QACf,YAAY,EAAE,qCAAqC;QACnD,SAAS,EAAE,mCAAmC;KAC/C,CAAC,CACH;IACD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyStringSchema,\n nonNegativeIntegerSchema,\n} from \"../schema\";\nimport { OrganizationBillingStatusSchema } from \"./organizationBilling\";\nimport { OrganizationBillingHistoryEntrySchema } from \"./organizationBillingHistory\";\nimport { OrganizationDataUsageResponseSchema } from \"./organizationDataUsage\";\nimport {\n RootIdentitySummaryResponseSchema,\n RootRosterSchema,\n rootOrganizationBillingShape,\n} from \"./root\";\n\nexport const RootOrganizationSummaryResponseSchema = loosePlainObject({\n organizationId: nonEmptyStringSchema,\n createdAt: z.string(),\n billingStatus: OrganizationBillingStatusSchema.nullable(),\n});\nexport type RootOrganizationSummaryResponse = z.infer<\n typeof RootOrganizationSummaryResponseSchema\n>;\n\nexport const RootOrganizationsResponseSchema = loosePlainObject({\n organizations: arraySchema(RootOrganizationSummaryResponseSchema),\n nextCursor: z.string().nullable(),\n});\nexport type RootOrganizationsResponse = z.infer<\n typeof RootOrganizationsResponseSchema\n>;\n\nconst RootOrganizationBillingResponseSchema = loosePlainObject({\n ...rootOrganizationBillingShape,\n currentPeriodStartsAt: z.string().nullable(),\n providerCustomerId: z.string().nullable(),\n providerSubscriptionId: z.string().nullable(),\n providerProductId: z.string().nullable(),\n providerTransactionId: z.string().nullable(),\n entitlementId: z.string().nullable(),\n purgeStartedAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\n/** Persisted group bindings plus roster and seat counts; no names or content. */\nconst RootOrganizationOverviewResponseSchema = loosePlainObject({\n adminGroupId: nonEmptyStringSchema,\n memberGroupId: nonEmptyStringSchema,\n activeMemberCount: nonNegativeIntegerSchema,\n disabledMemberCount: nonNegativeIntegerSchema,\n /** Active members who paused the organization's sync to their devices. */\n syncPausedMemberCount: nonNegativeIntegerSchema,\n /** Unreleased billable-seat assignments, the billing panel's assigned seats. */\n openSeatAssignmentCount: nonNegativeIntegerSchema,\n});\n\nconst RootOrganizationStripeResponseSchema = loosePlainObject({\n customerId: z.string().nullable(),\n subscriptionId: z.string().nullable(),\n subscriptionItemId: z.string().nullable(),\n priceId: z.string().nullable(),\n lastInvoiceId: z.string().nullable(),\n desiredPaidCapacity: nonNegativeIntegerSchema,\n desiredRenewalQuantity: nonNegativeIntegerSchema,\n appliedPaidCapacity: nonNegativeIntegerSchema,\n observedQuantity: nonNegativeIntegerSchema.nullable(),\n lastSyncedAt: z.string().nullable(),\n nextAttemptAt: z.string().nullable(),\n attemptCount: nonNegativeIntegerSchema,\n lastError: z.string().nullable(),\n});\n\nexport const RootOrganizationDetailResponseSchema = loosePlainObject({\n organization: RootOrganizationSummaryResponseSchema,\n overview: RootOrganizationOverviewResponseSchema,\n billing: RootOrganizationBillingResponseSchema.nullable(),\n stripe: RootOrganizationStripeResponseSchema.nullable(),\n /** The 50 most recent merged durable billing events. */\n history: arraySchema(OrganizationBillingHistoryEntrySchema),\n});\nexport type RootOrganizationDetailResponse = z.infer<\n typeof RootOrganizationDetailResponseSchema\n>;\n\nexport const RootOrganizationIdentityResponseSchema = loosePlainObject({\n identity: RootIdentitySummaryResponseSchema,\n roster: RootRosterSchema,\n});\nexport type RootOrganizationIdentityResponse = z.infer<\n typeof RootOrganizationIdentityResponseSchema\n>;\nexport const RootOrganizationIdentitiesResponseSchema = loosePlainObject({\n identities: arraySchema(RootOrganizationIdentityResponseSchema),\n nextCursor: z.string().nullable(),\n});\nexport type RootOrganizationIdentitiesResponse = z.infer<\n typeof RootOrganizationIdentitiesResponseSchema\n>;\n\nexport const RootDataUsageReportResponseSchema = loosePlainObject({\n organizations: arraySchema(\n loosePlainObject({\n organization: RootOrganizationSummaryResponseSchema,\n dataUsage: OrganizationDataUsageResponseSchema,\n }),\n ),\n nextCursor: z.string().nullable(),\n});\nexport type RootDataUsageReportResponse = z.infer<\n typeof RootDataUsageReportResponseSchema\n>;\n"]}
@@ -6,6 +6,7 @@ export { MAX_CONTAINER_PATH_LENGTH } from "./containerLimits.js";
6
6
  export { MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS, MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS, MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS, MAX_DOCUMENT_SYNC_OUTGOING_UPDATES, MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH, MAX_DOCUMENT_SYNC_REQUEST_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_ENVELOPE_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_PAGE_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_PAGE_UPDATES, MAX_DOCUMENT_SYNC_RESPONSE_UPDATE_PAGE_BYTES, } from "./documentSyncLimits.js";
7
7
  export { isSerializedKeyEnvelope, isSerializedKeyEnvelopeArray, type SerializedKeyEnvelope, } from "./keyEnvelope.js";
8
8
  export { KNOWN_MANIFEST_HINT_LIMIT, KnownManifestsHeadersSchema, parseKnownManifestHints, } from "./knownManifestWire.js";
9
+ export { isOrganizationLeaveRequest, type OrganizationLeaveRequest, OrganizationLeaveRequestSchema, } from "./organizationLeaveRequest.js";
9
10
  export { isOrganizationReplacementAuthorization, type OrganizationReplacementAuthorization, OrganizationReplacementAuthorizationSchema, } from "./organizationReplacement.js";
10
11
  export { PRINCIPAL_POLICY_HISTORY_PAGE_LIMIT, PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT, } from "./principalHistoryWire.js";
11
12
  export { hasArrayProperty, hasBooleanProperty, hasNonEmptyStringProperty, hasNullableNumberProperty, hasNullableStringProperty, hasNumberProperty, hasObjectProperty, hasOptionalStringProperty, hasPositiveIntegerProperty, hasPropertyValue, hasStringProperty, isNonEmptyStringArray, isOptionalRecordArray, isOptionalRecordArrayArray, isRecordArray, isRecordArrayArray, isStringArray, } from "./properties.js";
@@ -6,6 +6,7 @@ export { MAX_CONTAINER_PATH_LENGTH } from "./containerLimits.js";
6
6
  export { MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS, MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS, MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS, MAX_DOCUMENT_SYNC_OUTGOING_UPDATES, MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH, MAX_DOCUMENT_SYNC_REQUEST_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_ENVELOPE_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_PAGE_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_PAGE_UPDATES, MAX_DOCUMENT_SYNC_RESPONSE_UPDATE_PAGE_BYTES, } from "./documentSyncLimits.js";
7
7
  export { isSerializedKeyEnvelope, isSerializedKeyEnvelopeArray, } from "./keyEnvelope.js";
8
8
  export { KNOWN_MANIFEST_HINT_LIMIT, KnownManifestsHeadersSchema, parseKnownManifestHints, } from "./knownManifestWire.js";
9
+ export { isOrganizationLeaveRequest, OrganizationLeaveRequestSchema, } from "./organizationLeaveRequest.js";
9
10
  export { isOrganizationReplacementAuthorization, OrganizationReplacementAuthorizationSchema, } from "./organizationReplacement.js";
10
11
  export { PRINCIPAL_POLICY_HISTORY_PAGE_LIMIT, PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT, } from "./principalHistoryWire.js";
11
12
  export { hasArrayProperty, hasBooleanProperty, hasNonEmptyStringProperty, hasNullableNumberProperty, hasNullableStringProperty, hasNumberProperty, hasObjectProperty, hasOptionalStringProperty, hasPositiveIntegerProperty, hasPropertyValue, hasStringProperty, isNonEmptyStringArray, isOptionalRecordArray, isOptionalRecordArrayArray, isRecordArray, isRecordArrayArray, isStringArray, } from "./properties.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mCAAmC,EAGnC,sCAAsC,EACtC,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,kCAAkC,EAClC,uCAAuC,GACxC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAE9B,iCAAiC,EAEjC,6BAA6B,EAE7B,mCAAmC,EACnC,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,mCAAmC,EACnC,mCAAmC,EACnC,+BAA+B,EAC/B,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,8CAA8C,EAC9C,gDAAgD,EAChD,wCAAwC,EACxC,yCAAyC,EACzC,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,yCAAyC,EACzC,qCAAqC,EACrC,qCAAqC,EACrC,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,yCAAyC,EACzC,qCAAqC,EACrC,uCAAuC,EACvC,4CAA4C,GAC7C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAE7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sCAAsC,EAEtC,0CAA0C,GAC3C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export {\n type AccessEventBundleWireResponse,\n AccessEventBundleWireResponseSchema,\n type AccessManifestBundleWire,\n type AccessManifestBundleWireResponse,\n AccessManifestBundleWireResponseSchema,\n AccessManifestBundleWireSchema,\n isAccessEventBundleWireResponse,\n isAccessManifestBundleWire,\n isAccessManifestBundleWireArray,\n isAccessManifestBundleWireResponse,\n isOptionalAccessManifestBundleWireArray,\n} from \"./accessManifestBundle\";\nexport {\n MAX_INITIATE_PART_UPLOADS,\n MAX_MULTIPART_BLOB_PART_BYTES,\n} from \"./blob\";\nexport {\n blobPartContentMd5Schema,\n MAX_MULTIPART_BLOB_PART_NUMBER,\n type MultipartBlobPartDescriptor,\n MultipartBlobPartDescriptorSchema,\n type MultipartBlobPartUpload,\n MultipartBlobPartUploadSchema,\n type MultipartBlobPartUploadSource,\n MultipartBlobPartUploadSourceSchema,\n signedBlobUrlExpirySchema,\n signedBlobUrlSchema,\n} from \"./blobTransferSchemas\";\nexport {\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n CONTAINER_KEK_LOG_PRINCIPAL_SCOPE_LIMIT,\n CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT,\n ContainerKekKeyringWireRecordSchema,\n isContainerKekKeyringWireRecord,\n MAX_CONTAINER_KEY_EPOCH,\n MAX_INLINE_CONTAINER_REKEYS,\n MAX_ROTATION_CONTAINER_REKEYS,\n MAX_SEALED_CONTAINER_KEK_KEYRING_BASE64_LENGTH,\n SEALED_CONTAINER_KEK_KEYRING_AEAD_OVERHEAD_BYTES,\n SEALED_CONTAINER_KEK_KEYRING_ENTRY_BYTES,\n SEALED_CONTAINER_KEK_KEYRING_HEADER_BYTES,\n sealedContainerKekKeyringBytes,\n} from \"./containerKekKeyringWire\";\nexport { MAX_CONTAINER_PATH_LENGTH } from \"./containerLimits\";\nexport {\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS,\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_ENVELOPE_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_PAGE_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_PAGE_UPDATES,\n MAX_DOCUMENT_SYNC_RESPONSE_UPDATE_PAGE_BYTES,\n} from \"./documentSyncLimits\";\nexport {\n isSerializedKeyEnvelope,\n isSerializedKeyEnvelopeArray,\n type SerializedKeyEnvelope,\n} from \"./keyEnvelope\";\nexport {\n KNOWN_MANIFEST_HINT_LIMIT,\n KnownManifestsHeadersSchema,\n parseKnownManifestHints,\n} from \"./knownManifestWire\";\nexport {\n isOrganizationReplacementAuthorization,\n type OrganizationReplacementAuthorization,\n OrganizationReplacementAuthorizationSchema,\n} from \"./organizationReplacement\";\nexport {\n PRINCIPAL_POLICY_HISTORY_PAGE_LIMIT,\n PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT,\n} from \"./principalHistoryWire\";\nexport {\n hasArrayProperty,\n hasBooleanProperty,\n hasNonEmptyStringProperty,\n hasNullableNumberProperty,\n hasNullableStringProperty,\n hasNumberProperty,\n hasObjectProperty,\n hasOptionalStringProperty,\n hasPositiveIntegerProperty,\n hasPropertyValue,\n hasStringProperty,\n isNonEmptyStringArray,\n isOptionalRecordArray,\n isOptionalRecordArrayArray,\n isRecordArray,\n isRecordArrayArray,\n isStringArray,\n} from \"./properties\";\nexport {\n AUTH_CHALLENGE_HEX_LENGTH,\n isAuthChallengeHexString,\n isByteArray,\n isByteArrayOfLength,\n isSha256HexString,\n ML_DSA87_PUBLIC_KEY_BYTES,\n ML_DSA87_SIGNATURE_BYTES,\n ML_KEM1024_PUBLIC_KEY_BYTES,\n SHA256_HEX_LENGTH,\n} from \"./protocol\";\nexport {\n CANONICAL_SIGNED_AT_PATTERN,\n isCanonicalSignedAt,\n MAX_SIGNED_AT_YEAR,\n MIN_SIGNED_AT_YEAR,\n SIGNED_AT_CONTRACT,\n} from \"./signedAt\";\nexport { isUuidV4String } from \"./uuid\";\nexport { isWalLsnString, parseWalLsn } from \"./walLsn\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mCAAmC,EAGnC,sCAAsC,EACtC,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,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AA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export {\n type AccessEventBundleWireResponse,\n AccessEventBundleWireResponseSchema,\n type AccessManifestBundleWire,\n type AccessManifestBundleWireResponse,\n AccessManifestBundleWireResponseSchema,\n AccessManifestBundleWireSchema,\n isAccessEventBundleWireResponse,\n isAccessManifestBundleWire,\n isAccessManifestBundleWireArray,\n isAccessManifestBundleWireResponse,\n isOptionalAccessManifestBundleWireArray,\n} from \"./accessManifestBundle\";\nexport {\n MAX_INITIATE_PART_UPLOADS,\n MAX_MULTIPART_BLOB_PART_BYTES,\n} from \"./blob\";\nexport {\n blobPartContentMd5Schema,\n MAX_MULTIPART_BLOB_PART_NUMBER,\n type MultipartBlobPartDescriptor,\n MultipartBlobPartDescriptorSchema,\n type MultipartBlobPartUpload,\n MultipartBlobPartUploadSchema,\n type MultipartBlobPartUploadSource,\n MultipartBlobPartUploadSourceSchema,\n signedBlobUrlExpirySchema,\n signedBlobUrlSchema,\n} from \"./blobTransferSchemas\";\nexport {\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n CONTAINER_KEK_LOG_PRINCIPAL_SCOPE_LIMIT,\n CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT,\n ContainerKekKeyringWireRecordSchema,\n isContainerKekKeyringWireRecord,\n MAX_CONTAINER_KEY_EPOCH,\n MAX_INLINE_CONTAINER_REKEYS,\n MAX_ROTATION_CONTAINER_REKEYS,\n MAX_SEALED_CONTAINER_KEK_KEYRING_BASE64_LENGTH,\n SEALED_CONTAINER_KEK_KEYRING_AEAD_OVERHEAD_BYTES,\n SEALED_CONTAINER_KEK_KEYRING_ENTRY_BYTES,\n SEALED_CONTAINER_KEK_KEYRING_HEADER_BYTES,\n sealedContainerKekKeyringBytes,\n} from \"./containerKekKeyringWire\";\nexport { MAX_CONTAINER_PATH_LENGTH } from \"./containerLimits\";\nexport {\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS,\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_ENVELOPE_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_PAGE_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_PAGE_UPDATES,\n MAX_DOCUMENT_SYNC_RESPONSE_UPDATE_PAGE_BYTES,\n} from \"./documentSyncLimits\";\nexport {\n isSerializedKeyEnvelope,\n isSerializedKeyEnvelopeArray,\n type SerializedKeyEnvelope,\n} from \"./keyEnvelope\";\nexport {\n KNOWN_MANIFEST_HINT_LIMIT,\n KnownManifestsHeadersSchema,\n parseKnownManifestHints,\n} from \"./knownManifestWire\";\nexport {\n isOrganizationLeaveRequest,\n type OrganizationLeaveRequest,\n OrganizationLeaveRequestSchema,\n} from \"./organizationLeaveRequest\";\nexport {\n isOrganizationReplacementAuthorization,\n type OrganizationReplacementAuthorization,\n OrganizationReplacementAuthorizationSchema,\n} from \"./organizationReplacement\";\nexport {\n PRINCIPAL_POLICY_HISTORY_PAGE_LIMIT,\n PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT,\n} from \"./principalHistoryWire\";\nexport {\n hasArrayProperty,\n hasBooleanProperty,\n hasNonEmptyStringProperty,\n hasNullableNumberProperty,\n hasNullableStringProperty,\n hasNumberProperty,\n hasObjectProperty,\n hasOptionalStringProperty,\n hasPositiveIntegerProperty,\n hasPropertyValue,\n hasStringProperty,\n isNonEmptyStringArray,\n isOptionalRecordArray,\n isOptionalRecordArrayArray,\n isRecordArray,\n isRecordArrayArray,\n isStringArray,\n} from \"./properties\";\nexport {\n AUTH_CHALLENGE_HEX_LENGTH,\n isAuthChallengeHexString,\n isByteArray,\n isByteArrayOfLength,\n isSha256HexString,\n ML_DSA87_PUBLIC_KEY_BYTES,\n ML_DSA87_SIGNATURE_BYTES,\n ML_KEM1024_PUBLIC_KEY_BYTES,\n SHA256_HEX_LENGTH,\n} from \"./protocol\";\nexport {\n CANONICAL_SIGNED_AT_PATTERN,\n isCanonicalSignedAt,\n MAX_SIGNED_AT_YEAR,\n MIN_SIGNED_AT_YEAR,\n SIGNED_AT_CONTRACT,\n} from \"./signedAt\";\nexport { isUuidV4String } from \"./uuid\";\nexport { isWalLsnString, parseWalLsn } from \"./walLsn\";\n"]}
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * A member's signed request to leave an organization. Signed with the member's
4
+ * identity key so an administrator can tell the request came from the member,
5
+ * not from the server. It authorizes nothing by itself: leaving still needs an
6
+ * administrator to sign the member's removal from the organization's groups.
7
+ */
8
+ export declare const OrganizationLeaveRequestSchema: z.ZodObject<{
9
+ organizationId: z.ZodCustom<string, string>;
10
+ userId: z.ZodCustom<string, string>;
11
+ requestedAt: z.ZodString;
12
+ signature: z.ZodString;
13
+ }, z.core.$strict>;
14
+ export type OrganizationLeaveRequest = z.infer<typeof OrganizationLeaveRequestSchema>;
15
+ export declare function isOrganizationLeaveRequest(value: unknown): value is OrganizationLeaveRequest;
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { registerJsonSchemaFragment } from "../jsonSchema.js";
3
+ import { nonEmptyStringSchema, uuidV4StringSchema } from "../schema.js";
4
+ import { CANONICAL_SIGNED_AT_PATTERN, isCanonicalSignedAt, SIGNED_AT_CONTRACT, } from "./signedAt.js";
5
+ /**
6
+ * A member's signed request to leave an organization. Signed with the member's
7
+ * identity key so an administrator can tell the request came from the member,
8
+ * not from the server. It authorizes nothing by itself: leaving still needs an
9
+ * administrator to sign the member's removal from the organization's groups.
10
+ */
11
+ export const OrganizationLeaveRequestSchema = z.strictObject({
12
+ organizationId: uuidV4StringSchema,
13
+ userId: uuidV4StringSchema,
14
+ requestedAt: registerJsonSchemaFragment(z.string().refine(isCanonicalSignedAt, {
15
+ message: `requestedAt must be ${SIGNED_AT_CONTRACT}`,
16
+ }), { pattern: CANONICAL_SIGNED_AT_PATTERN.source, type: "string" }),
17
+ signature: nonEmptyStringSchema,
18
+ });
19
+ export function isOrganizationLeaveRequest(value) {
20
+ return OrganizationLeaveRequestSchema.safeParse(value).success;
21
+ }
22
+ //# sourceMappingURL=organizationLeaveRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organizationLeaveRequest.js","sourceRoot":"","sources":["organizationLeaveRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,cAAc,EAAE,kBAAkB;IAClC,MAAM,EAAE,kBAAkB;IAC1B,WAAW,EAAE,0BAA0B,CACrC,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,mBAAmB,EAAE;QACrC,OAAO,EAAE,uBAAuB,kBAAkB,EAAE;KACrD,CAAC,EACF,EAAE,OAAO,EAAE,2BAA2B,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAChE;IACD,SAAS,EAAE,oBAAoB;CAChC,CAAC,CAAC;AAMH,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,OAAO,8BAA8B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACjE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { registerJsonSchemaFragment } from \"../jsonSchema\";\nimport { nonEmptyStringSchema, uuidV4StringSchema } from \"../schema\";\nimport {\n CANONICAL_SIGNED_AT_PATTERN,\n isCanonicalSignedAt,\n SIGNED_AT_CONTRACT,\n} from \"./signedAt\";\n\n/**\n * A member's signed request to leave an organization. Signed with the member's\n * identity key so an administrator can tell the request came from the member,\n * not from the server. It authorizes nothing by itself: leaving still needs an\n * administrator to sign the member's removal from the organization's groups.\n */\nexport const OrganizationLeaveRequestSchema = z.strictObject({\n organizationId: uuidV4StringSchema,\n userId: uuidV4StringSchema,\n requestedAt: registerJsonSchemaFragment(\n z.string().refine(isCanonicalSignedAt, {\n message: `requestedAt must be ${SIGNED_AT_CONTRACT}`,\n }),\n { pattern: CANONICAL_SIGNED_AT_PATTERN.source, type: \"string\" },\n ),\n signature: nonEmptyStringSchema,\n});\n\nexport type OrganizationLeaveRequest = z.infer<\n typeof OrganizationLeaveRequestSchema\n>;\n\nexport function isOrganizationLeaveRequest(\n value: unknown,\n): value is OrganizationLeaveRequest {\n return OrganizationLeaveRequestSchema.safeParse(value).success;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tearleads/client-sdk",
3
- "version": "0.1.88",
3
+ "version": "0.1.90",
4
4
  "description": "React-free Tearleads client runtime: local SQLite persistence, keys, sync, encrypted blobs, and domain workflows.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -7,6 +7,8 @@ export { revokeOrganizationContainerGrant } from "./containerGrantRevocation.js"
7
7
  export { GroupMembershipNameMismatchError } from "./groupNames/groupMembershipName.js";
8
8
  export { GroupShareNameMismatchError, shareRemoteContainerWithGroup, } from "./groupShare/index.js";
9
9
  export { deleteOrganizationGroup } from "./groups/deleteOrganizationGroup.js";
10
+ export { type OrganizationLeaveRequestResult, setOrganizationLeaveRequested, } from "./memberships/leaveRequest.js";
11
+ export { withVerifiedDirectoryUser, withVerifiedLeaveRequests, withVerifiedUserLeaveRequest, } from "./memberships/leaveRequestVerification.js";
10
12
  export { forgetPausedOrganizationContent, type OrganizationContentHost, type OrganizationMembership, type OrganizationMembershipApi, type OrganizationSyncPauseResult, refreshOrganizationMemberships, setOrganizationSyncPaused, } from "./memberships/organizationMemberships.js";
11
13
  export { buildOrganizationProfileDocumentPatch, createInitializedOrganizationProfileDocument, DEFAULT_PERSONAL_ORGANIZATION_PROFILE_NAME, getOrganizationProfileDocumentLocalId, ORGANIZATION_PROFILE_DOCUMENT_KIND, readOrganizationProfileName, } from "./organizationProfile.js";
12
14
  export { type ImportedOrganizationUser, importOrganizationUser, } from "./organizationUserImport.js";
@@ -6,6 +6,8 @@ export { revokeOrganizationContainerGrant } from "./containerGrantRevocation.js"
6
6
  export { GroupMembershipNameMismatchError } from "./groupNames/groupMembershipName.js";
7
7
  export { GroupShareNameMismatchError, shareRemoteContainerWithGroup, } from "./groupShare/index.js";
8
8
  export { deleteOrganizationGroup } from "./groups/deleteOrganizationGroup.js";
9
+ export { setOrganizationLeaveRequested, } from "./memberships/leaveRequest.js";
10
+ export { withVerifiedDirectoryUser, withVerifiedLeaveRequests, withVerifiedUserLeaveRequest, } from "./memberships/leaveRequestVerification.js";
9
11
  export { forgetPausedOrganizationContent, refreshOrganizationMemberships, setOrganizationSyncPaused, } from "./memberships/organizationMemberships.js";
10
12
  export { buildOrganizationProfileDocumentPatch, createInitializedOrganizationProfileDocument, DEFAULT_PERSONAL_ORGANIZATION_PROFILE_NAME, getOrganizationProfileDocumentLocalId, ORGANIZATION_PROFILE_DOCUMENT_KIND, readOrganizationProfileName, } from "./organizationProfile.js";
11
13
  export { importOrganizationUser, } from "./organizationUserImport.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,0CAA0C,GAC3C,MAAM,wEAAwE,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4DAA4D,CAAC;AAK3G,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,mCAAmC,EACnC,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,8BAA8B,EAC9B,oCAAoC,EACpC,yBAAyB,EAOzB,8BAA8B,EAG9B,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EACL,+BAA+B,EAK/B,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,qCAAqC,EACrC,4CAA4C,EAC5C,0CAA0C,EAC1C,qCAAqC,EACrC,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iCAAiC,EACjC,2CAA2C,EAC3C,8BAA8B,GAC/B,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAEL,oCAAoC,EACpC,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAGL,mCAAmC,GACpC,MAAM,0DAA0D,CAAC;AAClE,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,oCAAoC,EACpC,uBAAuB,EACvB,2BAA2B,EAC3B,yCAAyC,GAC1C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,mCAAmC,EAwBnC,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,8BAA8B,EAG9B,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,oCAAoC,EACpC,oCAAoC,EACpC,uCAAuC,EACvC,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,uCAAuC,EACvC,iCAAiC,EAEjC,uCAAuC,GACxC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,6CAA6C,EAC7C,kDAAkD,EAClD,+BAA+B,EAC/B,oCAAoC,EACpC,0CAA0C,EAC1C,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n type OrganizationReadModelInvalidationListener,\n subscribeOrganizationReadModelInvalidation,\n} from \"../../data/persistence/organizations/organizationReadModelInvalidation\";\nexport { PendingPrincipalMutationError } from \"../../data/persistence/principalMutationJournalPersistence\";\nexport type {\n AuthoredPrincipalMutation,\n PrincipalMutationJournalScope,\n} from \"../../data/principals/principalMutationJournal\";\nexport { UnreadablePrincipalMutationError } from \"../../data/principals/principalMutationJournalRecord\";\nexport {\n cancelStripeSubscription,\n checkNativePurchaseEligibility,\n claimNativeOrganizationSubscription,\n createStripeCheckout,\n createStripeCheckoutSession,\n loadOrganizationBilling,\n loadOrganizationBillingHistory,\n loadOrganizationBillingManagementUrl,\n loadStripeCheckoutOptions,\n type OrganizationBilling,\n type OrganizationBillingHistory,\n type OrganizationBillingHistoryEntry,\n type OrganizationBillingManagementUrl,\n type OrganizationBillingView,\n type OrganizationNativePurchaseEligibility,\n resolveOrganizationBillingView,\n type StripeCheckoutIntent,\n type StripeCheckoutOptions,\n startOrganizationTrial,\n} from \"./billing\";\nexport { revokeOrganizationContainerGrant } from \"./containerGrantRevocation\";\nexport { GroupMembershipNameMismatchError } from \"./groupNames/groupMembershipName\";\nexport {\n GroupShareNameMismatchError,\n shareRemoteContainerWithGroup,\n} from \"./groupShare\";\nexport { deleteOrganizationGroup } from \"./groups/deleteOrganizationGroup\";\nexport {\n forgetPausedOrganizationContent,\n type OrganizationContentHost,\n type OrganizationMembership,\n type OrganizationMembershipApi,\n type OrganizationSyncPauseResult,\n refreshOrganizationMemberships,\n setOrganizationSyncPaused,\n} from \"./memberships/organizationMemberships\";\nexport {\n buildOrganizationProfileDocumentPatch,\n createInitializedOrganizationProfileDocument,\n DEFAULT_PERSONAL_ORGANIZATION_PROFILE_NAME,\n getOrganizationProfileDocumentLocalId,\n ORGANIZATION_PROFILE_DOCUMENT_KIND,\n readOrganizationProfileName,\n} from \"./organizationProfile\";\nexport {\n type ImportedOrganizationUser,\n importOrganizationUser,\n} from \"./organizationUserImport\";\nexport {\n abandonJournaledPrincipalMutation,\n discardUnreadableJournaledPrincipalMutation,\n readJournaledPrincipalMutation,\n} from \"./principalMutations/principalMutationJournalManagement\";\nexport {\n type PrincipalMutationJournalContext,\n PrincipalMutationOutcomeUnknownError,\n recoverJournaledPrincipalMutation,\n submitJournaledPrincipalMutation,\n} from \"./principalMutations/principalMutationJournalSession\";\nexport type { PrincipalMutationResponse } from \"./principalMutations/principalOperationReceipt\";\nexport {\n type AcknowledgedPrincipalCurrentInput,\n type AcknowledgedPrincipalCurrentRetirement,\n retainAcknowledgedPrincipalCurrents,\n} from \"./principalMutations/retainAcknowledgedPrincipalCurrents\";\nexport {\n addOrganizationGroupUser,\n buildInitialGroupPolicyRequest,\n buildInitialMemberGroupPolicyRequest,\n createOrganizationGroup,\n removeOrganizationGroupUser,\n rotateOrganizationGroupForAccessSetShrink,\n} from \"./principalPolicy\";\nexport {\n type CreateOrganizationApi,\n type CreateOrganizationInput,\n createOrganization,\n} from \"./provisioning/createOrganization\";\nexport {\n buildOrganizationGroupPolicyHistory,\n type OrganizationContainerGrant,\n type OrganizationContainerGrants,\n type OrganizationDirectory,\n type OrganizationDirectoryAndGroups,\n type OrganizationDirectoryUser,\n type OrganizationGroupContainer,\n type OrganizationGroupContainers,\n type OrganizationGroupDetails,\n type OrganizationGroupMember,\n type OrganizationGroupMembers,\n type OrganizationGroupPolicyHistory,\n type OrganizationGroupPolicyHistoryEntry,\n type OrganizationGroupSummary,\n type OrganizationPolicyGrantChange,\n type OrganizationPolicyGroupChange,\n type OrganizationPolicyHistory,\n type OrganizationPolicyHistoryEntry,\n type OrganizationPrincipalMemberChange,\n type OrganizationPrincipalMemberChangeType,\n type OrganizationPrincipalPolicyHistory,\n type OrganizationPrincipalPolicyHistoryEntry,\n type OrganizationProfile,\n type OrganizationUserDetail,\n updateOrganizationProfile,\n updateOrganizationRosterEntry,\n} from \"./readModel\";\nexport {\n loadLocalOrganizationDataUsage,\n type OrganizationDataUsage,\n type ReconcileOrganizationDataUsageInput,\n reconcileOrganizationDataUsage,\n} from \"./readModel/dataUsageReadModel\";\nexport {\n type LocalOrganizationSummary,\n listLocalOrganizations,\n} from \"./readModel/listLocalOrganizations\";\nexport {\n loadLocalOrganizationContainerGrants,\n loadLocalOrganizationGroupContainers,\n loadLocalOrganizationGroupPolicyHistory,\n loadLocalOrganizationPolicyHistory,\n loadLocalOrganizationPolicyReference,\n loadLocalOrganizationUserDetail,\n} from \"./readModel/localReadModelDetails\";\nexport {\n loadLocalOrganizationDirectoryAndGroups,\n loadLocalOrganizationGroupMembers,\n type ReconcileOrganizationDirectoryAndGroupsInput,\n reconcileOrganizationDirectoryAndGroups,\n} from \"./readModel/readModelProjection\";\nexport {\n buildRosterProfileDocumentPatch,\n createInitializedRosterProfileDocument,\n deriveOrganizationMetadataContainerSystemSlot,\n deriveOrganizationRosterProfileContainerSystemSlot,\n getRosterProfileDocumentLocalId,\n ORGANIZATION_METADATA_CONTAINER_NAME,\n ORGANIZATION_ROSTER_PROFILE_CONTAINER_NAME,\n ROSTER_PROFILE_DOCUMENT_KIND,\n} from \"./rosterProfileContainer\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,0CAA0C,GAC3C,MAAM,wEAAwE,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4DAA4D,CAAC;AAK3G,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,mCAAmC,EACnC,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,8BAA8B,EAC9B,oCAAoC,EACpC,yBAAyB,EAOzB,8BAA8B,EAG9B,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAEL,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,+BAA+B,EAK/B,8BAA8B,EAC9B,yBAAyB,GAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,qCAAqC,EACrC,4CAA4C,EAC5C,0CAA0C,EAC1C,qCAAqC,EACrC,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,iCAAiC,EACjC,2CAA2C,EAC3C,8BAA8B,GAC/B,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAEL,oCAAoC,EACpC,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAGL,mCAAmC,GACpC,MAAM,0DAA0D,CAAC;AAClE,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,oCAAoC,EACpC,uBAAuB,EACvB,2BAA2B,EAC3B,yCAAyC,GAC1C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,mCAAmC,EAwBnC,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,8BAA8B,EAG9B,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,oCAAoC,EACpC,oCAAoC,EACpC,uCAAuC,EACvC,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,uCAAuC,EACvC,iCAAiC,EAEjC,uCAAuC,GACxC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,6CAA6C,EAC7C,kDAAkD,EAClD,+BAA+B,EAC/B,oCAAoC,EACpC,0CAA0C,EAC1C,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n type OrganizationReadModelInvalidationListener,\n subscribeOrganizationReadModelInvalidation,\n} from \"../../data/persistence/organizations/organizationReadModelInvalidation\";\nexport { PendingPrincipalMutationError } from \"../../data/persistence/principalMutationJournalPersistence\";\nexport type {\n AuthoredPrincipalMutation,\n PrincipalMutationJournalScope,\n} from \"../../data/principals/principalMutationJournal\";\nexport { UnreadablePrincipalMutationError } from \"../../data/principals/principalMutationJournalRecord\";\nexport {\n cancelStripeSubscription,\n checkNativePurchaseEligibility,\n claimNativeOrganizationSubscription,\n createStripeCheckout,\n createStripeCheckoutSession,\n loadOrganizationBilling,\n loadOrganizationBillingHistory,\n loadOrganizationBillingManagementUrl,\n loadStripeCheckoutOptions,\n type OrganizationBilling,\n type OrganizationBillingHistory,\n type OrganizationBillingHistoryEntry,\n type OrganizationBillingManagementUrl,\n type OrganizationBillingView,\n type OrganizationNativePurchaseEligibility,\n resolveOrganizationBillingView,\n type StripeCheckoutIntent,\n type StripeCheckoutOptions,\n startOrganizationTrial,\n} from \"./billing\";\nexport { revokeOrganizationContainerGrant } from \"./containerGrantRevocation\";\nexport { GroupMembershipNameMismatchError } from \"./groupNames/groupMembershipName\";\nexport {\n GroupShareNameMismatchError,\n shareRemoteContainerWithGroup,\n} from \"./groupShare\";\nexport { deleteOrganizationGroup } from \"./groups/deleteOrganizationGroup\";\nexport {\n type OrganizationLeaveRequestResult,\n setOrganizationLeaveRequested,\n} from \"./memberships/leaveRequest\";\nexport {\n withVerifiedDirectoryUser,\n withVerifiedLeaveRequests,\n withVerifiedUserLeaveRequest,\n} from \"./memberships/leaveRequestVerification\";\nexport {\n forgetPausedOrganizationContent,\n type OrganizationContentHost,\n type OrganizationMembership,\n type OrganizationMembershipApi,\n type OrganizationSyncPauseResult,\n refreshOrganizationMemberships,\n setOrganizationSyncPaused,\n} from \"./memberships/organizationMemberships\";\nexport {\n buildOrganizationProfileDocumentPatch,\n createInitializedOrganizationProfileDocument,\n DEFAULT_PERSONAL_ORGANIZATION_PROFILE_NAME,\n getOrganizationProfileDocumentLocalId,\n ORGANIZATION_PROFILE_DOCUMENT_KIND,\n readOrganizationProfileName,\n} from \"./organizationProfile\";\nexport {\n type ImportedOrganizationUser,\n importOrganizationUser,\n} from \"./organizationUserImport\";\nexport {\n abandonJournaledPrincipalMutation,\n discardUnreadableJournaledPrincipalMutation,\n readJournaledPrincipalMutation,\n} from \"./principalMutations/principalMutationJournalManagement\";\nexport {\n type PrincipalMutationJournalContext,\n PrincipalMutationOutcomeUnknownError,\n recoverJournaledPrincipalMutation,\n submitJournaledPrincipalMutation,\n} from \"./principalMutations/principalMutationJournalSession\";\nexport type { PrincipalMutationResponse } from \"./principalMutations/principalOperationReceipt\";\nexport {\n type AcknowledgedPrincipalCurrentInput,\n type AcknowledgedPrincipalCurrentRetirement,\n retainAcknowledgedPrincipalCurrents,\n} from \"./principalMutations/retainAcknowledgedPrincipalCurrents\";\nexport {\n addOrganizationGroupUser,\n buildInitialGroupPolicyRequest,\n buildInitialMemberGroupPolicyRequest,\n createOrganizationGroup,\n removeOrganizationGroupUser,\n rotateOrganizationGroupForAccessSetShrink,\n} from \"./principalPolicy\";\nexport {\n type CreateOrganizationApi,\n type CreateOrganizationInput,\n createOrganization,\n} from \"./provisioning/createOrganization\";\nexport {\n buildOrganizationGroupPolicyHistory,\n type OrganizationContainerGrant,\n type OrganizationContainerGrants,\n type OrganizationDirectory,\n type OrganizationDirectoryAndGroups,\n type OrganizationDirectoryUser,\n type OrganizationGroupContainer,\n type OrganizationGroupContainers,\n type OrganizationGroupDetails,\n type OrganizationGroupMember,\n type OrganizationGroupMembers,\n type OrganizationGroupPolicyHistory,\n type OrganizationGroupPolicyHistoryEntry,\n type OrganizationGroupSummary,\n type OrganizationPolicyGrantChange,\n type OrganizationPolicyGroupChange,\n type OrganizationPolicyHistory,\n type OrganizationPolicyHistoryEntry,\n type OrganizationPrincipalMemberChange,\n type OrganizationPrincipalMemberChangeType,\n type OrganizationPrincipalPolicyHistory,\n type OrganizationPrincipalPolicyHistoryEntry,\n type OrganizationProfile,\n type OrganizationUserDetail,\n updateOrganizationProfile,\n updateOrganizationRosterEntry,\n} from \"./readModel\";\nexport {\n loadLocalOrganizationDataUsage,\n type OrganizationDataUsage,\n type ReconcileOrganizationDataUsageInput,\n reconcileOrganizationDataUsage,\n} from \"./readModel/dataUsageReadModel\";\nexport {\n type LocalOrganizationSummary,\n listLocalOrganizations,\n} from \"./readModel/listLocalOrganizations\";\nexport {\n loadLocalOrganizationContainerGrants,\n loadLocalOrganizationGroupContainers,\n loadLocalOrganizationGroupPolicyHistory,\n loadLocalOrganizationPolicyHistory,\n loadLocalOrganizationPolicyReference,\n loadLocalOrganizationUserDetail,\n} from \"./readModel/localReadModelDetails\";\nexport {\n loadLocalOrganizationDirectoryAndGroups,\n loadLocalOrganizationGroupMembers,\n type ReconcileOrganizationDirectoryAndGroupsInput,\n reconcileOrganizationDirectoryAndGroups,\n} from \"./readModel/readModelProjection\";\nexport {\n buildRosterProfileDocumentPatch,\n createInitializedRosterProfileDocument,\n deriveOrganizationMetadataContainerSystemSlot,\n deriveOrganizationRosterProfileContainerSystemSlot,\n getRosterProfileDocumentLocalId,\n ORGANIZATION_METADATA_CONTAINER_NAME,\n ORGANIZATION_ROSTER_PROFILE_CONTAINER_NAME,\n ROSTER_PROFILE_DOCUMENT_KIND,\n} from \"./rosterProfileContainer\";\n"]}
@@ -0,0 +1,31 @@
1
+ import type { RequestResult } from "../../../internal/api-client/index.js";
2
+ import { type SigningKeyPair } from "../../../internal/crypto/index.js";
3
+ import type { OrganizationMembershipResponse } from "../../../internal/validators/response/index.js";
4
+ import type { OrganizationLeaveRequest } from "../../../internal/validators/util/index.js";
5
+ import type { OrganizationMembership } from "./organizationMemberships.js";
6
+ export interface OrganizationLeaveRequestApi {
7
+ setOrganizationLeaveRequest(organizationId: string, request: OrganizationLeaveRequest | null): Promise<RequestResult<OrganizationMembershipResponse>>;
8
+ }
9
+ export type OrganizationLeaveRequestResult = {
10
+ readonly status: "updated";
11
+ readonly membership: OrganizationMembership;
12
+ } | {
13
+ readonly status: "failed";
14
+ readonly httpStatus: number | null;
15
+ readonly message: string;
16
+ };
17
+ /**
18
+ * Files or withdraws the user's request to leave one organization. Filing
19
+ * signs the request with the user's identity key, so administrators can tell
20
+ * the member made it; it removes nothing until an administrator approves it.
21
+ */
22
+ export declare function setOrganizationLeaveRequested(input: {
23
+ readonly apiClient: OrganizationLeaveRequestApi;
24
+ readonly organizationId: string;
25
+ readonly requested: boolean;
26
+ readonly signer: {
27
+ readonly signingKeyPair: Pick<SigningKeyPair, "signingPrivateKey">;
28
+ readonly userId: string;
29
+ };
30
+ readonly now?: () => Date;
31
+ }): Promise<OrganizationLeaveRequestResult>;
@@ -0,0 +1,20 @@
1
+ import { signOrganizationLeaveRequest, } from "../../../internal/crypto/index.js";
2
+ /**
3
+ * Files or withdraws the user's request to leave one organization. Filing
4
+ * signs the request with the user's identity key, so administrators can tell
5
+ * the member made it; it removes nothing until an administrator approves it.
6
+ */
7
+ export async function setOrganizationLeaveRequested(input) {
8
+ const request = input.requested
9
+ ? signOrganizationLeaveRequest({
10
+ organizationId: input.organizationId,
11
+ requestedAt: (input.now?.() ?? new Date()).toISOString(),
12
+ userId: input.signer.userId,
13
+ }, input.signer.signingKeyPair)
14
+ : null;
15
+ const result = await input.apiClient.setOrganizationLeaveRequest(input.organizationId, request);
16
+ return result.ok
17
+ ? { membership: result.data, status: "updated" }
18
+ : { httpStatus: result.status, message: result.message, status: "failed" };
19
+ }
20
+ //# sourceMappingURL=leaveRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaveRequest.js","sourceRoot":"","sources":["leaveRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAoB3B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,KASnD;IACC,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS;QAC7B,CAAC,CAAC,4BAA4B,CAC1B;YACE,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;YACxD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;SAC5B,EACD,KAAK,CAAC,MAAM,CAAC,cAAc,CAC5B;QACH,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,2BAA2B,CAC9D,KAAK,CAAC,cAAc,EACpB,OAAO,CACR,CAAC;IACF,OAAO,MAAM,CAAC,EAAE;QACd,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE;QAChD,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["import type { RequestResult } from \"@tearleads/api-client\";\nimport {\n type SigningKeyPair,\n signOrganizationLeaveRequest,\n} from \"@tearleads/crypto\";\nimport type { OrganizationMembershipResponse } from \"@tearleads/validators/response\";\nimport type { OrganizationLeaveRequest } from \"@tearleads/validators/util\";\nimport type { OrganizationMembership } from \"./organizationMemberships\";\n\nexport interface OrganizationLeaveRequestApi {\n setOrganizationLeaveRequest(\n organizationId: string,\n request: OrganizationLeaveRequest | null,\n ): Promise<RequestResult<OrganizationMembershipResponse>>;\n}\n\nexport type OrganizationLeaveRequestResult =\n | { readonly status: \"updated\"; readonly membership: OrganizationMembership }\n | {\n readonly status: \"failed\";\n readonly httpStatus: number | null;\n readonly message: string;\n };\n\n/**\n * Files or withdraws the user's request to leave one organization. Filing\n * signs the request with the user's identity key, so administrators can tell\n * the member made it; it removes nothing until an administrator approves it.\n */\nexport async function setOrganizationLeaveRequested(input: {\n readonly apiClient: OrganizationLeaveRequestApi;\n readonly organizationId: string;\n readonly requested: boolean;\n readonly signer: {\n readonly signingKeyPair: Pick<SigningKeyPair, \"signingPrivateKey\">;\n readonly userId: string;\n };\n readonly now?: () => Date;\n}): Promise<OrganizationLeaveRequestResult> {\n const request = input.requested\n ? signOrganizationLeaveRequest(\n {\n organizationId: input.organizationId,\n requestedAt: (input.now?.() ?? new Date()).toISOString(),\n userId: input.signer.userId,\n },\n input.signer.signingKeyPair,\n )\n : null;\n const result = await input.apiClient.setOrganizationLeaveRequest(\n input.organizationId,\n request,\n );\n return result.ok\n ? { membership: result.data, status: \"updated\" }\n : { httpStatus: result.status, message: result.message, status: \"failed\" };\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { TrustedUserIdentityResolver } from "../../../data/trustedUserIdentity/index.js";
2
+ import type { OrganizationDirectoryAndGroups, OrganizationDirectoryUser, OrganizationUserDetail } from "../readModel/index.js";
3
+ /**
4
+ * The user as shown, with its leave request kept only when the member signed
5
+ * it. Every directory user a client presents passes through here, whether a
6
+ * read model or a mutation response carried it.
7
+ */
8
+ export declare function withVerifiedDirectoryUser(organizationId: string, user: OrganizationDirectoryUser, resolveTrustedUserIdentity: TrustedUserIdentityResolver): Promise<OrganizationDirectoryUser>;
9
+ /**
10
+ * Keeps only leave requests their member signed, checked against the member's
11
+ * trusted identity; any other is shown as no request at all.
12
+ */
13
+ export declare function withVerifiedLeaveRequests<Result extends OrganizationDirectoryAndGroups | null | undefined>(result: Result, resolveTrustedUserIdentity: TrustedUserIdentityResolver): Promise<Result>;
14
+ /** The user detail counterpart of withVerifiedLeaveRequests. */
15
+ export declare function withVerifiedUserLeaveRequest(detail: OrganizationUserDetail | null, organizationId: string, resolveTrustedUserIdentity: TrustedUserIdentityResolver): Promise<OrganizationUserDetail | null>;
@@ -0,0 +1,46 @@
1
+ import { isValidOrganizationLeaveRequest } from "../../../internal/crypto/index.js";
2
+ /**
3
+ * The user as shown, with its leave request kept only when the member signed
4
+ * it. Every directory user a client presents passes through here, whether a
5
+ * read model or a mutation response carried it.
6
+ */
7
+ export async function withVerifiedDirectoryUser(organizationId, user, resolveTrustedUserIdentity) {
8
+ const request = user.leaveRequest;
9
+ if (!request)
10
+ return user;
11
+ // The member's pinned identity, never the key the directory served beside
12
+ // the request: a server that could swap both could forge any member's ask.
13
+ const identity = await resolveTrustedUserIdentity(user.userId).catch(() => null);
14
+ const verified = identity !== null &&
15
+ request.organizationId === organizationId &&
16
+ request.userId === user.userId &&
17
+ isValidOrganizationLeaveRequest(request, identity.signingPublicKey);
18
+ return verified ? user : { ...user, leaveRequest: null };
19
+ }
20
+ /**
21
+ * Keeps only leave requests their member signed, checked against the member's
22
+ * trusted identity; any other is shown as no request at all.
23
+ */
24
+ export async function withVerifiedLeaveRequests(result, resolveTrustedUserIdentity) {
25
+ if (!result?.directory.users.some((user) => user.leaveRequest)) {
26
+ return result;
27
+ }
28
+ const { organizationId } = result.directory;
29
+ return {
30
+ ...result,
31
+ directory: {
32
+ ...result.directory,
33
+ users: await Promise.all(result.directory.users.map((user) => withVerifiedDirectoryUser(organizationId, user, resolveTrustedUserIdentity))),
34
+ },
35
+ };
36
+ }
37
+ /** The user detail counterpart of withVerifiedLeaveRequests. */
38
+ export async function withVerifiedUserLeaveRequest(detail, organizationId, resolveTrustedUserIdentity) {
39
+ if (!detail?.user.leaveRequest)
40
+ return detail;
41
+ return {
42
+ ...detail,
43
+ user: await withVerifiedDirectoryUser(organizationId, detail.user, resolveTrustedUserIdentity),
44
+ };
45
+ }
46
+ //# sourceMappingURL=leaveRequestVerification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaveRequestVerification.js","sourceRoot":"","sources":["leaveRequestVerification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAQpE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,cAAsB,EACtB,IAA+B,EAC/B,0BAAuD;IAEvD,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;IAClC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,0EAA0E;IAC1E,2EAA2E;IAC3E,MAA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QACT,IAAI,EAAE,MAAM,yBAAyB,CACnC,cAAc,EACd,MAAM,CAAC,IAAI,EACX,0BAA0B,CAC3B;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { isValidOrganizationLeaveRequest } from \"@tearleads/crypto\";\nimport type { TrustedUserIdentityResolver } from \"../../../data/trustedUserIdentity\";\nimport type {\n OrganizationDirectoryAndGroups,\n OrganizationDirectoryUser,\n OrganizationUserDetail,\n} from \"../readModel\";\n\n/**\n * The user as shown, with its leave request kept only when the member signed\n * it. Every directory user a client presents passes through here, whether a\n * read model or a mutation response carried it.\n */\nexport async function withVerifiedDirectoryUser(\n organizationId: string,\n user: OrganizationDirectoryUser,\n resolveTrustedUserIdentity: TrustedUserIdentityResolver,\n): Promise<OrganizationDirectoryUser> {\n const request = user.leaveRequest;\n if (!request) return user;\n // The member's pinned identity, never the key the directory served beside\n // the request: a server that could swap both could forge any member's ask.\n const identity = await resolveTrustedUserIdentity(user.userId).catch(\n () => null,\n );\n const verified =\n identity !== null &&\n request.organizationId === organizationId &&\n request.userId === user.userId &&\n isValidOrganizationLeaveRequest(request, identity.signingPublicKey);\n return verified ? user : { ...user, leaveRequest: null };\n}\n\n/**\n * Keeps only leave requests their member signed, checked against the member's\n * trusted identity; any other is shown as no request at all.\n */\nexport async function withVerifiedLeaveRequests<\n Result extends OrganizationDirectoryAndGroups | null | undefined,\n>(\n result: Result,\n resolveTrustedUserIdentity: TrustedUserIdentityResolver,\n): Promise<Result> {\n if (!result?.directory.users.some((user) => user.leaveRequest)) {\n return result;\n }\n const { organizationId } = result.directory;\n return {\n ...result,\n directory: {\n ...result.directory,\n users: await Promise.all(\n result.directory.users.map((user) =>\n withVerifiedDirectoryUser(\n organizationId,\n user,\n resolveTrustedUserIdentity,\n ),\n ),\n ),\n },\n };\n}\n\n/** The user detail counterpart of withVerifiedLeaveRequests. */\nexport async function withVerifiedUserLeaveRequest(\n detail: OrganizationUserDetail | null,\n organizationId: string,\n resolveTrustedUserIdentity: TrustedUserIdentityResolver,\n): Promise<OrganizationUserDetail | null> {\n if (!detail?.user.leaveRequest) return detail;\n return {\n ...detail,\n user: await withVerifiedDirectoryUser(\n organizationId,\n detail.user,\n resolveTrustedUserIdentity,\n ),\n };\n}\n"]}