@tearleads/client-sdk 0.1.201 → 0.1.203

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 (48) hide show
  1. package/client/containerContents/documentDiscovery.js +9 -7
  2. package/client/containerContents/documentDiscovery.js.map +1 -1
  3. package/client/organizations/principalMutations.js +8 -4
  4. package/client/organizations/principalMutations.js.map +1 -1
  5. package/data/persistence/documents/containerDocumentTombstoneHoldRepository.js +112 -0
  6. package/data/persistence/documents/containerDocumentTombstoneHoldRepository.js.map +1 -0
  7. package/data/persistence/documents/containerDocumentTombstoneHoldsPersistence.js +0 -96
  8. package/data/persistence/documents/containerDocumentTombstoneHoldsPersistence.js.map +1 -1
  9. package/index.d.ts +2 -2
  10. package/index.js +1 -1
  11. package/index.js.map +1 -1
  12. package/package.json +1 -1
  13. package/workflows/container-contents/container-state/remote.js +23 -28
  14. package/workflows/container-contents/container-state/remote.js.map +1 -1
  15. package/workflows/container-contents/container-state/types.js.map +1 -1
  16. package/workflows/container-contents/documentQueries/documentSubtreeQueries.js +3 -2
  17. package/workflows/container-contents/documentQueries/documentSubtreeQueries.js.map +1 -1
  18. package/workflows/containers/child/create/createSubmission.d.ts +6 -8
  19. package/workflows/containers/child/create/createSubmission.js.map +1 -1
  20. package/workflows/containers/child/create/index.d.ts +4 -3
  21. package/workflows/containers/child/create/index.js +7 -1
  22. package/workflows/containers/child/create/index.js.map +1 -1
  23. package/workflows/containers/child/move/index.d.ts +6 -10
  24. package/workflows/containers/child/move/index.js +5 -4
  25. package/workflows/containers/child/move/index.js.map +1 -1
  26. package/workflows/containers/child/rekey/rekeyRemote.d.ts +6 -9
  27. package/workflows/containers/child/rekey/rekeyRemote.js +3 -1
  28. package/workflows/containers/child/rekey/rekeyRemote.js.map +1 -1
  29. package/workflows/containers/child/revoke.d.ts +4 -9
  30. package/workflows/containers/child/revoke.js +3 -1
  31. package/workflows/containers/child/revoke.js.map +1 -1
  32. package/workflows/containers/child/share/index.d.ts +5 -13
  33. package/workflows/containers/child/share/index.js +7 -1
  34. package/workflows/containers/child/share/index.js.map +1 -1
  35. package/workflows/containers/child/share/shareAncestorRepair.js +5 -4
  36. package/workflows/containers/child/share/shareAncestorRepair.js.map +1 -1
  37. package/workflows/containers/containerMutationCollaborators.d.ts +30 -0
  38. package/workflows/containers/containerMutationCollaborators.js +9 -0
  39. package/workflows/containers/containerMutationCollaborators.js.map +1 -0
  40. package/workflows/containers/containerMutationService.d.ts +32 -0
  41. package/workflows/containers/containerMutationService.js +43 -0
  42. package/workflows/containers/containerMutationService.js.map +1 -0
  43. package/workflows/containers/index.d.ts +9 -6
  44. package/workflows/containers/index.js +3 -5
  45. package/workflows/containers/index.js.map +1 -1
  46. package/workflows/organizations/containerGrantRevocation.d.ts +3 -11
  47. package/workflows/organizations/containerGrantRevocation.js +1 -6
  48. package/workflows/organizations/containerGrantRevocation.js.map +1 -1
@@ -1,5 +1,4 @@
1
1
  import { createProjectionUserKeyResolver } from "../../data/keyingProjectionVerification/userKeyResolver.js";
2
- import { revokeRemoteContainer } from "../containers/index.js";
3
2
  import { resolveDocumentCreateAuthor } from "../documents/index.js";
4
3
  export async function revokeOrganizationContainerGrant(input) {
5
4
  const author = resolveDocumentCreateAuthor({
@@ -15,18 +14,14 @@ export async function revokeOrganizationContainerGrant(input) {
15
14
  if (!author) {
16
15
  throw new Error("Org Manager signing context is unavailable");
17
16
  }
18
- const revoked = await revokeRemoteContainer({
17
+ const revoked = await input.containers.revokeRemoteContainer({
19
18
  stillCurrent: input.stillCurrent,
20
- reportSecurityIncident: input.reportSecurityIncident,
21
- apiClient: input.apiClient,
22
19
  author,
23
20
  containerId: input.containerId,
24
- execSql: input.execSql,
25
21
  revokedSubject: input.revokedSubject,
26
22
  resolveProjectionUserKey: createProjectionUserKeyResolver({
27
23
  resolveTrustedUserIdentity: input.resolveTrustedUserIdentity,
28
24
  }),
29
- targetSecretKey: input.encapsulationKeyPair.secretKey,
30
25
  warmReferencedPrincipalPolicies: input.warmReferencedPrincipalPolicies,
31
26
  });
32
27
  if (!revoked) {
@@ -1 +1 @@
1
- {"version":3,"file":"containerGrantRevocation.js","sourceRoot":"","sources":["containerGrantRevocation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yDAAyD,CAAC;AAI1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAW3D,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,KAsBtD;IACC,MAAM,MAAM,GAAG,2BAA2B,CAAC;QACzC,IAAI,EAAE;YACJ,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,MAAM,EAAE,KAAK,CAAC,YAAY;SAC3B;QACD,MAAM,EAAE;YACN,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,cAAc,EAAE,KAAK,CAAC,cAAc;SACrC;KACF,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC;QAC1C,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;QACpD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,MAAM;QACN,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,wBAAwB,EAAE,+BAA+B,CAAC;YACxD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B;SAC7D,CAAC;QACF,eAAe,EAAE,KAAK,CAAC,oBAAoB,CAAC,SAAS;QACrD,+BAA+B,EAAE,KAAK,CAAC,+BAA+B;KACvE,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC","sourcesContent":["import type { ContainerDirectGrant } from \"@tearleads/crypto\";\nimport type { ContainerMutationResponse } from \"@tearleads/validators/response\";\nimport type { ReferencedPrincipalPolicyWarmer } from \"../../data/keyingProjectionVerification\";\nimport { createProjectionUserKeyResolver } from \"../../data/keyingProjectionVerification/userKeyResolver\";\nimport type { SecurityIncidentReporter } from \"../../data/shared/securityIncidents\";\nimport type { ExecSql } from \"../../data/sqlite/sqlSchema\";\nimport type { TrustedUserIdentityResolver } from \"../../data/trustedUserIdentity\";\nimport { revokeRemoteContainer } from \"../containers\";\nimport { resolveDocumentCreateAuthor } from \"../documents\";\n\ntype OrganizationContainerGrantSubject = Pick<\n ContainerDirectGrant,\n \"subjectId\" | \"subjectType\"\n>;\n\ntype OrganizationContainerGrantRevocationApi = Parameters<\n typeof revokeRemoteContainer\n>[0][\"apiClient\"];\n\nexport async function revokeOrganizationContainerGrant(input: {\n readonly stillCurrent: () => boolean;\n readonly reportSecurityIncident: SecurityIncidentReporter;\n readonly apiClient: OrganizationContainerGrantRevocationApi;\n readonly containerId: string;\n readonly encapsulationKeyPair: {\n readonly publicKey: Uint8Array;\n readonly secretKey: Uint8Array;\n };\n readonly execSql: ExecSql;\n readonly organizationId: string;\n readonly resolveTrustedUserIdentity: TrustedUserIdentityResolver;\n readonly revokedSubject: OrganizationContainerGrantSubject;\n readonly signerUserId: string;\n readonly signingFingerprint: string;\n readonly signingKeyPair: {\n readonly signingPrivateKey: Uint8Array;\n readonly signingPublicKey: Uint8Array;\n };\n readonly warmReferencedPrincipalPolicies?:\n | ReferencedPrincipalPolicyWarmer\n | undefined;\n}): Promise<ContainerMutationResponse> {\n const author = resolveDocumentCreateAuthor({\n auth: {\n organizationId: input.organizationId,\n userId: input.signerUserId,\n },\n crypto: {\n signingFingerprint: input.signingFingerprint,\n signingKeyPair: input.signingKeyPair,\n },\n });\n if (!author) {\n throw new Error(\"Org Manager signing context is unavailable\");\n }\n\n const revoked = await revokeRemoteContainer({\n stillCurrent: input.stillCurrent,\n reportSecurityIncident: input.reportSecurityIncident,\n apiClient: input.apiClient,\n author,\n containerId: input.containerId,\n execSql: input.execSql,\n revokedSubject: input.revokedSubject,\n resolveProjectionUserKey: createProjectionUserKeyResolver({\n resolveTrustedUserIdentity: input.resolveTrustedUserIdentity,\n }),\n targetSecretKey: input.encapsulationKeyPair.secretKey,\n warmReferencedPrincipalPolicies: input.warmReferencedPrincipalPolicies,\n });\n if (!revoked) {\n throw new Error(\"Container grant could not be revoked\");\n }\n\n return revoked.response;\n}\n"]}
1
+ {"version":3,"file":"containerGrantRevocation.js","sourceRoot":"","sources":["containerGrantRevocation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yDAAyD,CAAC;AAG1G,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAO3D,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,KAiBtD;IACC,MAAM,MAAM,GAAG,2BAA2B,CAAC;QACzC,IAAI,EAAE;YACJ,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,MAAM,EAAE,KAAK,CAAC,YAAY;SAC3B;QACD,MAAM,EAAE;YACN,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;YAC5C,cAAc,EAAE,KAAK,CAAC,cAAc;SACrC;KACF,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC;QAC3D,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,MAAM;QACN,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,wBAAwB,EAAE,+BAA+B,CAAC;YACxD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B;SAC7D,CAAC;QACF,+BAA+B,EAAE,KAAK,CAAC,+BAA+B;KACvE,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC","sourcesContent":["import type { ContainerDirectGrant } from \"@tearleads/crypto\";\nimport type { ContainerMutationResponse } from \"@tearleads/validators/response\";\nimport type { ReferencedPrincipalPolicyWarmer } from \"../../data/keyingProjectionVerification\";\nimport { createProjectionUserKeyResolver } from \"../../data/keyingProjectionVerification/userKeyResolver\";\nimport type { TrustedUserIdentityResolver } from \"../../data/trustedUserIdentity\";\nimport type { ContainerMutationService } from \"../containers\";\nimport { resolveDocumentCreateAuthor } from \"../documents\";\n\ntype OrganizationContainerGrantSubject = Pick<\n ContainerDirectGrant,\n \"subjectId\" | \"subjectType\"\n>;\n\nexport async function revokeOrganizationContainerGrant(input: {\n readonly stillCurrent: () => boolean;\n readonly containerId: string;\n /** Bound to the runtime snapshot whose encapsulation key reaches the container. */\n readonly containers: ContainerMutationService;\n readonly organizationId: string;\n readonly resolveTrustedUserIdentity: TrustedUserIdentityResolver;\n readonly revokedSubject: OrganizationContainerGrantSubject;\n readonly signerUserId: string;\n readonly signingFingerprint: string;\n readonly signingKeyPair: {\n readonly signingPrivateKey: Uint8Array;\n readonly signingPublicKey: Uint8Array;\n };\n readonly warmReferencedPrincipalPolicies?:\n | ReferencedPrincipalPolicyWarmer\n | undefined;\n}): Promise<ContainerMutationResponse> {\n const author = resolveDocumentCreateAuthor({\n auth: {\n organizationId: input.organizationId,\n userId: input.signerUserId,\n },\n crypto: {\n signingFingerprint: input.signingFingerprint,\n signingKeyPair: input.signingKeyPair,\n },\n });\n if (!author) {\n throw new Error(\"Org Manager signing context is unavailable\");\n }\n\n const revoked = await input.containers.revokeRemoteContainer({\n stillCurrent: input.stillCurrent,\n author,\n containerId: input.containerId,\n revokedSubject: input.revokedSubject,\n resolveProjectionUserKey: createProjectionUserKeyResolver({\n resolveTrustedUserIdentity: input.resolveTrustedUserIdentity,\n }),\n warmReferencedPrincipalPolicies: input.warmReferencedPrincipalPolicies,\n });\n if (!revoked) {\n throw new Error(\"Container grant could not be revoked\");\n }\n\n return revoked.response;\n}\n"]}