@fragno-dev/backoffice-api 0.0.0-stage → 0.0.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.
Files changed (135) hide show
  1. package/LICENSE.md +16 -0
  2. package/README.md +90 -2
  3. package/dist/api.d.ts +35 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +10 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/errors.d.ts +45 -0
  8. package/dist/errors.d.ts.map +1 -0
  9. package/dist/errors.js +35 -0
  10. package/dist/errors.js.map +1 -0
  11. package/dist/openapi.d.ts +46 -0
  12. package/dist/openapi.d.ts.map +1 -0
  13. package/dist/openapi.js +205 -0
  14. package/dist/openapi.js.map +1 -0
  15. package/dist/v0/account.d.ts +171 -0
  16. package/dist/v0/account.d.ts.map +1 -0
  17. package/dist/v0/account.js +78 -0
  18. package/dist/v0/account.js.map +1 -0
  19. package/dist/v0/api.d.ts +3437 -0
  20. package/dist/v0/api.d.ts.map +1 -0
  21. package/dist/v0/api.js +52 -0
  22. package/dist/v0/api.js.map +1 -0
  23. package/dist/v0/app-actions.d.ts +105 -0
  24. package/dist/v0/app-actions.d.ts.map +1 -0
  25. package/dist/v0/app-actions.js +100 -0
  26. package/dist/v0/app-actions.js.map +1 -0
  27. package/dist/v0/apps.d.ts +417 -0
  28. package/dist/v0/apps.d.ts.map +1 -0
  29. package/dist/v0/apps.js +163 -0
  30. package/dist/v0/apps.js.map +1 -0
  31. package/dist/v0/automation.d.ts +730 -0
  32. package/dist/v0/automation.d.ts.map +1 -0
  33. package/dist/v0/automation.js +355 -0
  34. package/dist/v0/automation.js.map +1 -0
  35. package/dist/v0/capabilities.d.ts +97 -0
  36. package/dist/v0/capabilities.d.ts.map +1 -0
  37. package/dist/v0/capabilities.js +41 -0
  38. package/dist/v0/capabilities.js.map +1 -0
  39. package/dist/v0/client.d.ts +39 -0
  40. package/dist/v0/client.d.ts.map +1 -0
  41. package/dist/v0/client.js +61 -0
  42. package/dist/v0/client.js.map +1 -0
  43. package/dist/v0/events.d.ts +789 -0
  44. package/dist/v0/events.d.ts.map +1 -0
  45. package/dist/v0/events.js +153 -0
  46. package/dist/v0/events.js.map +1 -0
  47. package/dist/v0/forms.d.ts +172 -0
  48. package/dist/v0/forms.d.ts.map +1 -0
  49. package/dist/v0/forms.js +88 -0
  50. package/dist/v0/forms.js.map +1 -0
  51. package/dist/v0/hooks.d.ts +61 -0
  52. package/dist/v0/hooks.d.ts.map +1 -0
  53. package/dist/v0/hooks.js +49 -0
  54. package/dist/v0/hooks.js.map +1 -0
  55. package/dist/v0/identity.d.ts +73 -0
  56. package/dist/v0/identity.d.ts.map +1 -0
  57. package/dist/v0/identity.js +46 -0
  58. package/dist/v0/identity.js.map +1 -0
  59. package/dist/v0/integrations.d.ts +847 -0
  60. package/dist/v0/integrations.d.ts.map +1 -0
  61. package/dist/v0/integrations.js +255 -0
  62. package/dist/v0/integrations.js.map +1 -0
  63. package/dist/v0/javascript.d.ts +160 -0
  64. package/dist/v0/javascript.d.ts.map +1 -0
  65. package/dist/v0/javascript.js +123 -0
  66. package/dist/v0/javascript.js.map +1 -0
  67. package/dist/v0/marketplace.d.ts +825 -0
  68. package/dist/v0/marketplace.d.ts.map +1 -0
  69. package/dist/v0/marketplace.js +284 -0
  70. package/dist/v0/marketplace.js.map +1 -0
  71. package/dist/v0/organization.d.ts +182 -0
  72. package/dist/v0/organization.d.ts.map +1 -0
  73. package/dist/v0/organization.js +88 -0
  74. package/dist/v0/organization.js.map +1 -0
  75. package/dist/v0/otp.d.ts +37 -0
  76. package/dist/v0/otp.d.ts.map +1 -0
  77. package/dist/v0/otp.js +29 -0
  78. package/dist/v0/otp.js.map +1 -0
  79. package/dist/v0/pi.d.ts +322 -0
  80. package/dist/v0/pi.d.ts.map +1 -0
  81. package/dist/v0/pi.js +146 -0
  82. package/dist/v0/pi.js.map +1 -0
  83. package/dist/v0/sandbox.d.ts +173 -0
  84. package/dist/v0/sandbox.d.ts.map +1 -0
  85. package/dist/v0/sandbox.js +97 -0
  86. package/dist/v0/sandbox.js.map +1 -0
  87. package/dist/v0/shared/bytes.d.ts +12 -0
  88. package/dist/v0/shared/bytes.d.ts.map +1 -0
  89. package/dist/v0/shared/bytes.js +16 -0
  90. package/dist/v0/shared/bytes.js.map +1 -0
  91. package/dist/v0/shared/datetime.d.ts +10 -0
  92. package/dist/v0/shared/datetime.d.ts.map +1 -0
  93. package/dist/v0/shared/datetime.js +14 -0
  94. package/dist/v0/shared/datetime.js.map +1 -0
  95. package/dist/v0/shared/json.d.ts +9 -0
  96. package/dist/v0/shared/json.d.ts.map +1 -0
  97. package/dist/v0/shared/json.js +14 -0
  98. package/dist/v0/shared/json.js.map +1 -0
  99. package/dist/v0/shared/pagination.d.ts +11 -0
  100. package/dist/v0/shared/pagination.d.ts.map +1 -0
  101. package/dist/v0/shared/pagination.js +11 -0
  102. package/dist/v0/shared/pagination.js.map +1 -0
  103. package/dist/v0/shared/permissions.d.ts +279 -0
  104. package/dist/v0/shared/permissions.d.ts.map +1 -0
  105. package/dist/v0/shared/permissions.js +285 -0
  106. package/dist/v0/shared/permissions.js.map +1 -0
  107. package/dist/v0/shared/pi-agent-name.d.ts +10 -0
  108. package/dist/v0/shared/pi-agent-name.d.ts.map +1 -0
  109. package/dist/v0/shared/pi-agent-name.js +11 -0
  110. package/dist/v0/shared/pi-agent-name.js.map +1 -0
  111. package/dist/v0/shared/scope.d.ts +305 -0
  112. package/dist/v0/shared/scope.d.ts.map +1 -0
  113. package/dist/v0/shared/scope.js +279 -0
  114. package/dist/v0/shared/scope.js.map +1 -0
  115. package/dist/v0/state.d.ts +512 -0
  116. package/dist/v0/state.d.ts.map +1 -0
  117. package/dist/v0/state.js +267 -0
  118. package/dist/v0/state.js.map +1 -0
  119. package/dist/v0/store.d.ts +138 -0
  120. package/dist/v0/store.d.ts.map +1 -0
  121. package/dist/v0/store.js +83 -0
  122. package/dist/v0/store.js.map +1 -0
  123. package/dist/v0/upload.d.ts +568 -0
  124. package/dist/v0/upload.d.ts.map +1 -0
  125. package/dist/v0/upload.js +109 -0
  126. package/dist/v0/upload.js.map +1 -0
  127. package/dist/v0/web.d.ts +47 -0
  128. package/dist/v0/web.d.ts.map +1 -0
  129. package/dist/v0/web.js +31 -0
  130. package/dist/v0/web.js.map +1 -0
  131. package/dist/v0/workflow.d.ts +267 -0
  132. package/dist/v0/workflow.d.ts.map +1 -0
  133. package/dist/v0/workflow.js +116 -0
  134. package/dist/v0/workflow.js.map +1 -0
  135. package/package.json +64 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace.d.ts","names":[],"sources":["../../src/v0/marketplace.ts"],"mappings":";;cAUa,sBAAoB,EAAA,QAAA,EAAA;cASpB,0BAAwB,EAAA,QAAA,EAAA;;cAGxB,yCAAuC,EAAA,QAAA,EAAA;;;;cAwBvC,6BAA2B,EAAA,QAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkB5B,wBAAwB,EAAE,aAAa;cAEtC,wBAAsB,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOvB,mBAAmB,EAAE,aAAa;;cAGjC,wBAAsB,EAAA,QAAA,EAAA,uBAAA,EAAA;;;;;;KAOvB,mBAAmB,EAAE,aAAa;;cAGjC,6BAA2B,EAAA,QAAA,EAAA;;;;KAE5B,wBAAwB,EAAE,aAAa;cAEtC,iCAA+B,EAAA,QAAA,EAAA;;;;;;KAShC,4BAA4B,EAAE,aAAa;cAE1C;cAEA;;cAGA;cAEA;cAQA,uBAAqB,EAAA,QAAA,EAAA;cAWrB,+BAA6B,EAAA,QAAA,EAAA;;;;;;;cAM7B,2BAAyB,EAAA,QAAA,EAAA;;;;;;;cAEzB,kCAAgC,EAAA,QAAA,EAAA;;;;;;;;;;;;;KAMjC,6BAA6B,EAAE,aAAa;cAE3C,uCAAqC,EAAA,QAAA,EAAA,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;;;;;;;;;;;;;KAW/B,2BAA2B,EAAE,cAAc;;cAG1C,+BAA6B,EAAA,QAAA,EAAA;;;;;;;;;;;cA6B7B,uBAAqB,EAAA,QAAA,EAAA;;;;;;;;;;;;;cAsBrB,gCAA8B,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAS/B,2BAA2B,EAAE,aAAa;;cAGzC,+BAA6B,EAAA,QAAA,EAAA;;;;;;KAI9B,0BAA0B,EAAE,aAAa;;cAGxC,+BAA6B,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;KAe9B,0BAA0B,EAAE,aAAa;;cAGxC,iCAA+B,EAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;KAOhC,4BAA4B,EAAE,aAAa;cAK1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BA"}
@@ -0,0 +1,284 @@
1
+ import { BACKOFFICE_PERMISSION } from "./shared/permissions.js";
2
+ import { backofficeOrganizationScopeSchema, backofficeProjectScopeSchema, backofficeUserScopeSchema } from "./shared/scope.js";
3
+ import { z } from "zod";
4
+ //#region src/v0/marketplace.ts
5
+ const marketplaceTagSchema = z.lazy(() => z.string().trim().min(1).max(32).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, "Tags use lowercase words separated by hyphens."));
6
+ const marketplaceOwnerIdSchema = z.lazy(() => z.string().trim().min(1).max(191));
7
+ /** Scoped package names resolve to stable organization ownership, not a user or project owner. */
8
+ const marketplaceOrganizationOwnerScopeSchema = z.lazy(() => z.strictObject({
9
+ kind: z.literal("org"),
10
+ orgId: marketplaceOwnerIdSchema
11
+ }));
12
+ const marketplaceUserOwnerScopeSchema = z.lazy(() => z.object({
13
+ kind: z.literal("user"),
14
+ userId: marketplaceOwnerIdSchema
15
+ }));
16
+ const marketplaceAppOwnerScopeSchema = z.lazy(() => z.object({
17
+ kind: z.literal("app"),
18
+ owner: z.discriminatedUnion("kind", [marketplaceOrganizationOwnerScopeSchema, marketplaceUserOwnerScopeSchema]),
19
+ appId: marketplaceOwnerIdSchema
20
+ }));
21
+ const marketplaceOwnerScopeSchema = z.lazy(() => z.discriminatedUnion("kind", [
22
+ z.object({ kind: z.literal("system") }),
23
+ marketplaceOrganizationOwnerScopeSchema,
24
+ marketplaceUserOwnerScopeSchema,
25
+ marketplaceAppOwnerScopeSchema,
26
+ z.object({
27
+ kind: z.literal("project"),
28
+ owner: z.discriminatedUnion("kind", [
29
+ marketplaceOrganizationOwnerScopeSchema,
30
+ marketplaceUserOwnerScopeSchema,
31
+ marketplaceAppOwnerScopeSchema
32
+ ]),
33
+ projectId: marketplaceOwnerIdSchema
34
+ })
35
+ ]));
36
+ const marketplaceOwnerSchema = z.lazy(() => z.object({
37
+ scope: marketplaceOwnerScopeSchema,
38
+ publisherName: z.string().trim().min(1).max(191)
39
+ }));
40
+ /** System hosts the public Marketplace; each organization has its own members-only Marketplace. */
41
+ const marketplaceScopeSchema = z.lazy(() => z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("system") }), backofficeOrganizationScopeSchema]));
42
+ /** Organization visibility publishes into the owning organization's Marketplace. */
43
+ const marketplaceVisibilitySchema = z.lazy(() => z.enum(["public", "organization"]));
44
+ const marketplaceListingContentSchema = z.lazy(() => z.object({
45
+ name: z.string().trim().min(3).max(120),
46
+ summary: z.string().trim().min(10).max(240),
47
+ description: z.string().trim().min(20).max(1e4),
48
+ tags: z.array(marketplaceTagSchema).max(12).default([])
49
+ }));
50
+ const MARKETPLACE_RELEASE_IDENTIFIER = String.raw`(?:0|[1-9]\d*)`;
51
+ const MARKETPLACE_PRERELEASE_IDENTIFIER = String.raw`(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)`;
52
+ /** Each destination workspace has one root lock file, independent of installation folders. */
53
+ const MARKETPLACE_LOCK_PATH = "/workspace/marketplace-lock.json";
54
+ const MARKETPLACE_CATEGORIES = [
55
+ "communication",
56
+ "developer-tools",
57
+ "operations",
58
+ "productivity",
59
+ "reporting"
60
+ ];
61
+ const marketplaceSlugSchema = z.lazy(() => z.string().trim().min(3).max(80).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, "Use lowercase words separated by hyphens.")).meta({ examples: ["telegram-test-command"] });
62
+ const marketplacePackageOwnerSchema = z.lazy(() => marketplaceOwnerSchema._zod.innerType.extend({ scope: marketplaceOrganizationOwnerScopeSchema }));
63
+ const marketplaceCategorySchema = z.lazy(() => z.enum(MARKETPLACE_CATEGORIES));
64
+ const marketplaceListingMetadataSchema = z.lazy(() => marketplaceListingContentSchema._zod.innerType.extend({ category: marketplaceCategorySchema }));
65
+ const marketplaceIngestionTargetScopeSchema = z.lazy(() => z.discriminatedUnion("kind", [
66
+ backofficeOrganizationScopeSchema,
67
+ backofficeProjectScopeSchema,
68
+ backofficeUserScopeSchema
69
+ ]));
70
+ /** The workspace lock reserves its file path, including attempts to use it as a directory. */
71
+ function isMarketplaceLockPath(path) {
72
+ return path === "/workspace/marketplace-lock.json" || path.startsWith(`/workspace/marketplace-lock.json/`);
73
+ }
74
+ const MARKETPLACE_VERSION_PATTERN = new RegExp(String.raw`^${MARKETPLACE_RELEASE_IDENTIFIER}\.${MARKETPLACE_RELEASE_IDENTIFIER}\.${MARKETPLACE_RELEASE_IDENTIFIER}(?:-${MARKETPLACE_PRERELEASE_IDENTIFIER}(?:\.${MARKETPLACE_PRERELEASE_IDENTIFIER})*)?$`, "u");
75
+ const MARKETPLACE_MAX_PAGE_SIZE = 60;
76
+ const MARKETPLACE_DEFAULT_PAGE_SIZE = 18;
77
+ /** Each Marketplace curates a small featured set, so one bounded read loads every entry. */
78
+ const MARKETPLACE_FEATURED_LIMIT = 24;
79
+ const MARKETPLACE_DATABASE_ID_MAX_LENGTH = 128;
80
+ const marketplaceVersionSchema = z.lazy(() => z.string().trim().max(40).regex(MARKETPLACE_VERSION_PATTERN, "Use a semantic version such as 1.0.0.")).meta({ examples: ["1.0.0", "2.1.0-beta.1"] });
81
+ const marketplaceListingIdSchema = z.lazy(() => z.string().trim().min(5).max(128).regex(/^(?:system|org:[^#]+|user:[^#]+|project:[^#:]+:[^#]+)#[a-z0-9]+(?:-[a-z0-9]+)*$/u, "Use an owner-qualified marketplace listing id.")).meta({ examples: ["system#telegram-test-command", "org:org-123#deployment-notifier"] });
82
+ const packageIdentitySchema = z.lazy(() => z.strictObject({
83
+ name: z.string(),
84
+ listingId: marketplaceListingIdSchema,
85
+ version: marketplaceVersionSchema,
86
+ snapshotId: z.string(),
87
+ owner: marketplacePackageOwnerSchema,
88
+ marketplace: marketplaceScopeSchema,
89
+ files: z.array(z.strictObject({
90
+ relativePath: z.string(),
91
+ sizeBytes: z.number(),
92
+ checksum: z.string()
93
+ })),
94
+ sizeBytes: z.number()
95
+ }));
96
+ const marketplaceVersionSchemaPublic = z.lazy(() => z.object({
97
+ version: marketplaceVersionSchema,
98
+ publishedAt: z.string()
99
+ }));
100
+ const marketplaceVersionPageFields = {
101
+ versionPageSize: z.lazy(() => z.number().int().min(1).max(60).default(18)),
102
+ versionCursor: z.lazy(() => z.string().trim().min(1).optional())
103
+ };
104
+ const marketplacePublicListingSchema = z.lazy(() => marketplaceListingMetadataSchema._zod.innerType.extend({
105
+ listingId: marketplaceListingIdSchema,
106
+ slug: marketplaceSlugSchema,
107
+ publisherName: z.string(),
108
+ status: z.literal("published"),
109
+ latestVersion: marketplaceVersionSchema,
110
+ publishedAt: z.string(),
111
+ updatedAt: z.string(),
112
+ /** The listing has a feature entry whose window is open now. */
113
+ featured: z.boolean()
114
+ }));
115
+ const marketplaceListingPageInputSchema = z.lazy(() => z.object({
116
+ category: marketplaceCategorySchema.optional(),
117
+ pageSize: z.number().int().min(1).max(60).default(18),
118
+ cursor: z.string().trim().min(1).optional()
119
+ }));
120
+ /** Installation paths are absolute directories within the destination workspace. */
121
+ const marketplaceInstallationRootSchema = z.lazy(() => z.string().trim().transform((path) => path.replace(/\/+$/u, "")).pipe(z.string()).refine((path) => (path === "/workspace" || path.startsWith("/workspace/")) && !/[\\\p{Cc}]/u.test(path) && path.slice(1).split("/").every((part) => part !== "" && part !== "." && part !== ".."), "Choose an absolute install path under /workspace without '.' or '..' segments.").refine((path) => !isMarketplaceLockPath(path), "The workspace Marketplace lock file cannot be used as an install folder."));
122
+ /** Installation callers share the existing workflow restart result contract. */
123
+ const marketplaceIngestionRestartResultSchema = z.lazy(() => z.object({
124
+ listingId: marketplaceListingIdSchema,
125
+ version: marketplaceVersionSchema,
126
+ workflowInstanceId: z.string().min(1),
127
+ action: z.enum([
128
+ "created",
129
+ "restarted",
130
+ "unchanged"
131
+ ]),
132
+ workflowStatus: z.enum([
133
+ "active",
134
+ "paused",
135
+ "errored",
136
+ "terminated",
137
+ "complete",
138
+ "waiting"
139
+ ])
140
+ }));
141
+ /** Installation names the Marketplace holding the listing; listing ids repeat across Marketplaces. */
142
+ const marketplaceIngestionRequestInputSchema = z.lazy(() => z.object({
143
+ marketplace: marketplaceScopeSchema,
144
+ targetScope: marketplaceIngestionTargetScopeSchema,
145
+ installationRoot: marketplaceInstallationRootSchema,
146
+ listingId: marketplaceListingIdSchema,
147
+ version: marketplaceVersionSchema.optional()
148
+ }));
149
+ /** Installation reports the existing workflow result and its organization coordinator. */
150
+ const packagesInstallResultSchema = z.lazy(() => marketplaceIngestionRestartResultSchema._zod.innerType.extend({
151
+ installationRoot: marketplaceInstallationRootSchema,
152
+ workflowScope: z.object({
153
+ kind: z.literal("org"),
154
+ orgId: z.string().min(1)
155
+ })
156
+ }));
157
+ /** Read and install tools address the public Marketplace unless organization visibility is requested. */
158
+ const marketplaceReadVisibilityField = { visibility: z.lazy(() => marketplaceVisibilitySchema.default("public")) };
159
+ /** Package installation takes its destination scope and organization Marketplace from the runtime, not caller input. */
160
+ const packagesInstallInputSchema = z.lazy(() => marketplaceIngestionRequestInputSchema._zod.innerType.omit({
161
+ marketplace: true,
162
+ targetScope: true
163
+ }).extend(marketplaceReadVisibilityField).strict());
164
+ /** Registry search returns compact metadata and a cursor for the next candidate page. */
165
+ const marketplaceSearchResultSchema = z.lazy(() => z.object({
166
+ listings: z.array(marketplacePublicListingSchema._zod.innerType.pick({
167
+ listingId: true,
168
+ name: true,
169
+ summary: true,
170
+ publisherName: true,
171
+ category: true,
172
+ tags: true,
173
+ latestVersion: true,
174
+ featured: true
175
+ })),
176
+ nextCursor: z.string().nullable(),
177
+ hasNextPage: z.boolean()
178
+ }));
179
+ /** Search cursors advance through registry candidates, including pages without matches. */
180
+ const marketplaceSearchInputSchema = z.lazy(() => marketplaceListingPageInputSchema._zod.innerType.extend({
181
+ query: z.string().trim().min(1).max(240),
182
+ ...marketplaceReadVisibilityField
183
+ }));
184
+ const marketplacePublishedListingInputSchema = z.lazy(() => z.object({
185
+ listingId: marketplaceListingIdSchema,
186
+ ...marketplaceVersionPageFields
187
+ }));
188
+ const marketplaceViewInputSchema = z.lazy(() => marketplacePublishedListingInputSchema._zod.innerType.extend(marketplaceReadVisibilityField));
189
+ /** A dry run writes nothing; accepted packages return their durable System workflow identity. */
190
+ const marketplacePublishResultSchema = z.lazy(() => z.discriminatedUnion("state", [packageIdentitySchema._zod.innerType.extend({ state: z.literal("preview") }), packageIdentitySchema._zod.innerType.extend({
191
+ state: z.enum(["requested", "published"]),
192
+ workflowInstanceId: z.string(),
193
+ workflowScope: z.strictObject({ kind: z.literal("system") })
194
+ })]));
195
+ /** Publishing switches are enforced against the original caller, never the coordinator. */
196
+ const marketplacePublishInputSchema = z.lazy(() => z.strictObject({
197
+ packageRoot: z.string().trim().min(1).max(512).refine((path) => path.startsWith("/") && path !== "/" && !/[\\\p{Cc}]/u.test(path) && path.replace(/\/$/u, "").slice(1).split("/").every((segment) => segment && segment !== "." && segment !== ".."), "Marketplace package root must be an absolute directory path without traversal.").transform((path) => path.replace(/\/$/u, "")).pipe(z.string()),
198
+ visibility: marketplaceVisibilitySchema,
199
+ dryRun: z.boolean().default(false),
200
+ skipAuthorCheck: z.boolean().default(false),
201
+ skipVersionCheck: z.boolean().default(false)
202
+ }));
203
+ /** The workspace lock records one successful release per listing and installation folder. */
204
+ const marketplaceLockSchema = z.lazy(() => z.strictObject({ entries: z.array(z.strictObject({
205
+ marketplace: marketplaceScopeSchema.default({ kind: "system" }),
206
+ listingId: marketplaceListingIdSchema,
207
+ version: marketplaceVersionSchema,
208
+ installationRoot: marketplaceInstallationRootSchema
209
+ })) }).refine((lock) => new Set(lock.entries.map((entry) => JSON.stringify([entry.listingId, entry.installationRoot]))).size === lock.entries.length, "Marketplace lock entries must have unique listing and installation folder pairs."));
210
+ const marketplaceListingDetailSchema = z.lazy(() => z.object({
211
+ listing: marketplacePublicListingSchema,
212
+ versions: z.array(marketplaceVersionSchemaPublic),
213
+ nextVersionCursor: z.string().optional(),
214
+ hasNextVersionPage: z.boolean()
215
+ }));
216
+ /** Hidden entries belong to listings that are no longer published. */
217
+ const marketplaceFeatureStateSchema = z.lazy(() => z.enum([
218
+ "active",
219
+ "scheduled",
220
+ "expired",
221
+ "hidden"
222
+ ]));
223
+ /** Curators see every entry with its state; browsers only see active entries. */
224
+ const marketplaceFeatureEntrySchema = z.lazy(() => z.object({
225
+ listingId: marketplaceListingIdSchema,
226
+ name: z.string(),
227
+ state: marketplaceFeatureStateSchema,
228
+ priority: z.number().int(),
229
+ note: z.string().nullable(),
230
+ startsAt: z.string(),
231
+ until: z.string().nullable(),
232
+ featuredBy: z.string(),
233
+ createdAt: z.string(),
234
+ updatedAt: z.string()
235
+ }));
236
+ /** Featuring an already featured listing replaces its window, priority, and note. */
237
+ const marketplaceFeaturedResultSchema = z.lazy(() => z.object({
238
+ entries: z.array(marketplaceFeatureEntrySchema),
239
+ limit: z.number().int()
240
+ }));
241
+ const marketplaceOperations = {
242
+ "marketplace.search": {
243
+ description: "Search published package metadata in the public Marketplace, or in the current organization's Marketplace with organization visibility. Follow nextCursor while hasNextPage is true, even when a candidate page has no matches.",
244
+ permissions: [BACKOFFICE_PERMISSION.marketplace.read],
245
+ input: marketplaceSearchInputSchema,
246
+ output: marketplaceSearchResultSchema
247
+ },
248
+ "marketplace.view": {
249
+ description: "Inspect published package metadata and cursor-paginated releases in the public Marketplace, or in the current organization's Marketplace with organization visibility.",
250
+ permissions: [BACKOFFICE_PERMISSION.marketplace.read],
251
+ input: marketplaceViewInputSchema,
252
+ output: marketplaceListingDetailSchema
253
+ },
254
+ "marketplace.publish": {
255
+ description: "Publish a captured package from a root manifest.json containing name @<organization-slug>/<package-slug>. Public visibility publishes to the public Marketplace; organization visibility publishes to the owning organization's members-only Marketplace. Versions are immutable by default; System may explicitly replace them. Dry runs write nothing. Author and version overrides require System context.",
256
+ permissions: [BACKOFFICE_PERMISSION.marketplace.publish],
257
+ input: marketplacePublishInputSchema,
258
+ output: marketplacePublishResultSchema
259
+ },
260
+ "marketplace.featured": {
261
+ description: `List every feature entry with its state: active, scheduled, expired, or hidden (the listing is no longer published). In System scope this curates the public Marketplace and requires a System administrator; in organization scope it curates that organization's Marketplace and requires an organization owner or admin.`,
262
+ permissions: [BACKOFFICE_PERMISSION.marketplace.read],
263
+ input: z.lazy(() => z.strictObject({})),
264
+ output: marketplaceFeaturedResultSchema
265
+ }
266
+ };
267
+ const packagesOperations = {
268
+ "packages.install": {
269
+ description: "Start the existing Marketplace installation workflow in the current workspace at a required folder under /workspace. Installs from the public Marketplace, or from the installing organization's Marketplace with organization visibility. Installation is asynchronous. Installing another version at a folder that already holds the item upgrades it in place, replacing and removing files that still match the installed version; it fails without changes if a file it would replace was edited. Omit version to use the existing latest-release resolution.",
270
+ permissions: [BACKOFFICE_PERMISSION.packages.install],
271
+ input: packagesInstallInputSchema,
272
+ output: packagesInstallResultSchema
273
+ },
274
+ "packages.ls": {
275
+ description: "List successful package installations recorded in /workspace/marketplace-lock.json for the current workspace. A missing lock is empty; malformed locks fail without being modified.",
276
+ permissions: [BACKOFFICE_PERMISSION.packages.read],
277
+ input: z.lazy(() => z.strictObject({})),
278
+ output: marketplaceLockSchema
279
+ }
280
+ };
281
+ //#endregion
282
+ export { MARKETPLACE_CATEGORIES, MARKETPLACE_DATABASE_ID_MAX_LENGTH, MARKETPLACE_DEFAULT_PAGE_SIZE, MARKETPLACE_FEATURED_LIMIT, MARKETPLACE_LOCK_PATH, MARKETPLACE_MAX_PAGE_SIZE, MARKETPLACE_PRERELEASE_IDENTIFIER, MARKETPLACE_RELEASE_IDENTIFIER, MARKETPLACE_VERSION_PATTERN, isMarketplaceLockPath, marketplaceCategorySchema, marketplaceFeatureEntrySchema, marketplaceFeatureStateSchema, marketplaceFeaturedResultSchema, marketplaceIngestionRequestInputSchema, marketplaceIngestionRestartResultSchema, marketplaceIngestionTargetScopeSchema, marketplaceInstallationRootSchema, marketplaceListingContentSchema, marketplaceListingDetailSchema, marketplaceListingIdSchema, marketplaceListingMetadataSchema, marketplaceListingPageInputSchema, marketplaceLockSchema, marketplaceOperations, marketplaceOrganizationOwnerScopeSchema, marketplaceOwnerIdSchema, marketplaceOwnerSchema, marketplaceOwnerScopeSchema, marketplacePackageOwnerSchema, marketplacePublicListingSchema, marketplacePublishInputSchema, marketplacePublishResultSchema, marketplacePublishedListingInputSchema, marketplaceScopeSchema, marketplaceSearchInputSchema, marketplaceSearchResultSchema, marketplaceSlugSchema, marketplaceTagSchema, marketplaceVersionPageFields, marketplaceVersionSchema, marketplaceVersionSchemaPublic, marketplaceViewInputSchema, marketplaceVisibilitySchema, packageIdentitySchema, packagesInstallInputSchema, packagesInstallResultSchema, packagesOperations };
283
+
284
+ //# sourceMappingURL=marketplace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketplace.js","names":[],"sources":["../../src/v0/marketplace.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { BackofficeApiOperation } from \"../api\";\nimport { BACKOFFICE_PERMISSION } from \"./shared/permissions\";\nimport {\n backofficeOrganizationScopeSchema,\n backofficeProjectScopeSchema,\n backofficeUserScopeSchema,\n} from \"./shared/scope\";\n\nexport const marketplaceTagSchema = z.lazy(() =>\n z\n .string()\n .trim()\n .min(1)\n .max(32)\n .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, \"Tags use lowercase words separated by hyphens.\"),\n);\n\nexport const marketplaceOwnerIdSchema = z.lazy(() => z.string().trim().min(1).max(191));\n\n/** Scoped package names resolve to stable organization ownership, not a user or project owner. */\nexport const marketplaceOrganizationOwnerScopeSchema = z.lazy(() =>\n z.strictObject({\n kind: z.literal(\"org\"),\n orgId: marketplaceOwnerIdSchema,\n }),\n);\n\nconst marketplaceUserOwnerScopeSchema = z.lazy(() =>\n z.object({\n kind: z.literal(\"user\"),\n userId: marketplaceOwnerIdSchema,\n }),\n);\nconst marketplaceAppOwnerScopeSchema = z.lazy(() =>\n z.object({\n kind: z.literal(\"app\"),\n owner: z.discriminatedUnion(\"kind\", [\n marketplaceOrganizationOwnerScopeSchema,\n marketplaceUserOwnerScopeSchema,\n ]),\n appId: marketplaceOwnerIdSchema,\n }),\n);\n\nexport const marketplaceOwnerScopeSchema = z.lazy(() =>\n z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"system\") }),\n marketplaceOrganizationOwnerScopeSchema,\n marketplaceUserOwnerScopeSchema,\n marketplaceAppOwnerScopeSchema,\n z.object({\n kind: z.literal(\"project\"),\n owner: z.discriminatedUnion(\"kind\", [\n marketplaceOrganizationOwnerScopeSchema,\n marketplaceUserOwnerScopeSchema,\n marketplaceAppOwnerScopeSchema,\n ]),\n projectId: marketplaceOwnerIdSchema,\n }),\n ]),\n);\n\nexport type MarketplaceOwnerScope = z.infer<typeof marketplaceOwnerScopeSchema>;\n\nexport const marketplaceOwnerSchema = z.lazy(() =>\n z.object({\n scope: marketplaceOwnerScopeSchema,\n publisherName: z.string().trim().min(1).max(191),\n }),\n);\n\nexport type MarketplaceOwner = z.infer<typeof marketplaceOwnerSchema>;\n\n/** System hosts the public Marketplace; each organization has its own members-only Marketplace. */\nexport const marketplaceScopeSchema = z.lazy(() =>\n z.discriminatedUnion(\"kind\", [\n z.strictObject({ kind: z.literal(\"system\") }),\n backofficeOrganizationScopeSchema,\n ]),\n);\n\nexport type MarketplaceScope = z.infer<typeof marketplaceScopeSchema>;\n\n/** Organization visibility publishes into the owning organization's Marketplace. */\nexport const marketplaceVisibilitySchema = z.lazy(() => z.enum([\"public\", \"organization\"]));\n\nexport type MarketplaceVisibility = z.infer<typeof marketplaceVisibilitySchema>;\n\nexport const marketplaceListingContentSchema = z.lazy(() =>\n z.object({\n name: z.string().trim().min(3).max(120),\n summary: z.string().trim().min(10).max(240),\n description: z.string().trim().min(20).max(10_000),\n tags: z.array(marketplaceTagSchema).max(12).default([]),\n }),\n);\n\nexport type MarketplaceListingContent = z.infer<typeof marketplaceListingContentSchema>;\n\nexport const MARKETPLACE_RELEASE_IDENTIFIER = String.raw`(?:0|[1-9]\\d*)`;\n\nexport const MARKETPLACE_PRERELEASE_IDENTIFIER = String.raw`(?:0|[1-9]\\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)`;\n\n/** Each destination workspace has one root lock file, independent of installation folders. */\nexport const MARKETPLACE_LOCK_PATH = \"/workspace/marketplace-lock.json\";\n\nexport const MARKETPLACE_CATEGORIES = [\n \"communication\",\n \"developer-tools\",\n \"operations\",\n \"productivity\",\n \"reporting\",\n] as const;\n\nexport const marketplaceSlugSchema = z\n .lazy(() =>\n z\n .string()\n .trim()\n .min(3)\n .max(80)\n .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u, \"Use lowercase words separated by hyphens.\"),\n )\n .meta({ examples: [\"telegram-test-command\"] });\n\nexport const marketplacePackageOwnerSchema = z.lazy(() =>\n marketplaceOwnerSchema._zod.innerType.extend({\n scope: marketplaceOrganizationOwnerScopeSchema,\n }),\n);\n\nexport const marketplaceCategorySchema = z.lazy(() => z.enum(MARKETPLACE_CATEGORIES));\n\nexport const marketplaceListingMetadataSchema = z.lazy(() =>\n marketplaceListingContentSchema._zod.innerType.extend({\n category: marketplaceCategorySchema,\n }),\n);\n\nexport type MarketplaceListingMetadata = z.infer<typeof marketplaceListingMetadataSchema>;\n\nexport const marketplaceIngestionTargetScopeSchema = z.lazy(() =>\n z.discriminatedUnion(\"kind\", [\n backofficeOrganizationScopeSchema,\n backofficeProjectScopeSchema,\n backofficeUserScopeSchema,\n ]),\n);\nexport type MarketplaceIngestionTargetScope = z.infer<typeof marketplaceIngestionTargetScopeSchema>;\n\nexport type MarketplaceCategory = z.infer<typeof marketplaceCategorySchema>;\n\n/** The workspace lock reserves its file path, including attempts to use it as a directory. */\nexport function isMarketplaceLockPath(path: string): boolean {\n return path === MARKETPLACE_LOCK_PATH || path.startsWith(`${MARKETPLACE_LOCK_PATH}/`);\n}\n\nexport const MARKETPLACE_VERSION_PATTERN = new RegExp(\n String.raw`^${MARKETPLACE_RELEASE_IDENTIFIER}\\.${MARKETPLACE_RELEASE_IDENTIFIER}\\.${MARKETPLACE_RELEASE_IDENTIFIER}(?:-${MARKETPLACE_PRERELEASE_IDENTIFIER}(?:\\.${MARKETPLACE_PRERELEASE_IDENTIFIER})*)?$`,\n \"u\",\n);\n\nexport const MARKETPLACE_MAX_PAGE_SIZE = 60;\n\nexport const MARKETPLACE_DEFAULT_PAGE_SIZE = 18;\n\n/** Each Marketplace curates a small featured set, so one bounded read loads every entry. */\nexport const MARKETPLACE_FEATURED_LIMIT = 24;\n\nexport const MARKETPLACE_DATABASE_ID_MAX_LENGTH = 128;\n\nexport const marketplaceVersionSchema = z\n .lazy(() =>\n z\n .string()\n .trim()\n .max(40)\n .regex(MARKETPLACE_VERSION_PATTERN, \"Use a semantic version such as 1.0.0.\"),\n )\n .meta({ examples: [\"1.0.0\", \"2.1.0-beta.1\"] });\n\nexport const marketplaceListingIdSchema = z\n .lazy(() =>\n z\n .string()\n .trim()\n .min(5)\n .max(MARKETPLACE_DATABASE_ID_MAX_LENGTH)\n .regex(\n /^(?:system|org:[^#]+|user:[^#]+|project:[^#:]+:[^#]+)#[a-z0-9]+(?:-[a-z0-9]+)*$/u,\n \"Use an owner-qualified marketplace listing id.\",\n ),\n )\n .meta({\n examples: [\"system#telegram-test-command\", \"org:org-123#deployment-notifier\"],\n });\n\nexport const packageIdentitySchema = z.lazy(() =>\n z.strictObject({\n name: z.string(),\n listingId: marketplaceListingIdSchema,\n version: marketplaceVersionSchema,\n snapshotId: z.string(),\n owner: marketplacePackageOwnerSchema,\n marketplace: marketplaceScopeSchema,\n files: z.array(\n z.strictObject({ relativePath: z.string(), sizeBytes: z.number(), checksum: z.string() }),\n ),\n sizeBytes: z.number(),\n }),\n);\n\nexport const marketplaceVersionSchemaPublic = z.lazy(() =>\n z.object({\n version: marketplaceVersionSchema,\n publishedAt: z.string(),\n }),\n);\n\nexport type MarketplaceVersion = z.infer<typeof marketplaceVersionSchemaPublic>;\n\nexport const marketplaceVersionPageFields = {\n versionPageSize: z.lazy(() =>\n z.number().int().min(1).max(MARKETPLACE_MAX_PAGE_SIZE).default(MARKETPLACE_DEFAULT_PAGE_SIZE),\n ),\n versionCursor: z.lazy(() => z.string().trim().min(1).optional()),\n};\n\nexport const marketplacePublicListingSchema = z.lazy(() =>\n marketplaceListingMetadataSchema._zod.innerType.extend({\n listingId: marketplaceListingIdSchema,\n slug: marketplaceSlugSchema,\n publisherName: z.string(),\n status: z.literal(\"published\"),\n latestVersion: marketplaceVersionSchema,\n publishedAt: z.string(),\n updatedAt: z.string(),\n /** The listing has a feature entry whose window is open now. */\n featured: z.boolean(),\n }),\n);\n\nexport type MarketplaceListing = z.infer<typeof marketplacePublicListingSchema>;\n\nexport const marketplaceListingPageInputSchema = z.lazy(() =>\n z.object({\n category: marketplaceCategorySchema.optional(),\n pageSize: z\n .number()\n .int()\n .min(1)\n .max(MARKETPLACE_MAX_PAGE_SIZE)\n .default(MARKETPLACE_DEFAULT_PAGE_SIZE),\n cursor: z.string().trim().min(1).optional(),\n }),\n);\n\nexport type MarketplaceListingPageInput = z.input<typeof marketplaceListingPageInputSchema>;\n\n/** Installation paths are absolute directories within the destination workspace. */\nexport const marketplaceInstallationRootSchema = z.lazy(() =>\n z\n .string()\n .trim()\n .transform((path) => path.replace(/\\/+$/u, \"\"))\n // Declaration generation needs the transform's concrete output schema.\n .pipe(z.string())\n .refine(\n (path) =>\n (path === \"/workspace\" || path.startsWith(\"/workspace/\")) &&\n !/[\\\\\\p{Cc}]/u.test(path) &&\n path\n .slice(1)\n .split(\"/\")\n .every((part) => part !== \"\" && part !== \".\" && part !== \"..\"),\n \"Choose an absolute install path under /workspace without '.' or '..' segments.\",\n )\n .refine(\n (path) => !isMarketplaceLockPath(path),\n \"The workspace Marketplace lock file cannot be used as an install folder.\",\n ),\n);\n\n/** Installation callers share the existing workflow restart result contract. */\nexport const marketplaceIngestionRestartResultSchema = z.lazy(() =>\n z.object({\n listingId: marketplaceListingIdSchema,\n version: marketplaceVersionSchema,\n workflowInstanceId: z.string().min(1),\n action: z.enum([\"created\", \"restarted\", \"unchanged\"]),\n workflowStatus: z.enum([\"active\", \"paused\", \"errored\", \"terminated\", \"complete\", \"waiting\"]),\n }),\n);\n\nexport type MarketplaceIngestionRestartResult = z.infer<\n typeof marketplaceIngestionRestartResultSchema\n>;\n\n/** Installation names the Marketplace holding the listing; listing ids repeat across Marketplaces. */\nexport const marketplaceIngestionRequestInputSchema = z.lazy(() =>\n z.object({\n marketplace: marketplaceScopeSchema,\n targetScope: marketplaceIngestionTargetScopeSchema,\n installationRoot: marketplaceInstallationRootSchema,\n listingId: marketplaceListingIdSchema,\n version: marketplaceVersionSchema.optional(),\n }),\n);\n\nexport type MarketplaceIngestionRequestInput = z.infer<\n typeof marketplaceIngestionRequestInputSchema\n>;\n\n/** Installation reports the existing workflow result and its organization coordinator. */\nexport const packagesInstallResultSchema = z.lazy(() =>\n marketplaceIngestionRestartResultSchema._zod.innerType.extend({\n installationRoot: marketplaceInstallationRootSchema,\n workflowScope: z.object({ kind: z.literal(\"org\"), orgId: z.string().min(1) }),\n }),\n);\n\n/** Read and install tools address the public Marketplace unless organization visibility is requested. */\nconst marketplaceReadVisibilityField = {\n visibility: z.lazy(() => marketplaceVisibilitySchema.default(\"public\")),\n};\n\n/** Package installation takes its destination scope and organization Marketplace from the runtime, not caller input. */\nexport const packagesInstallInputSchema = z.lazy(() =>\n marketplaceIngestionRequestInputSchema._zod.innerType\n .omit({ marketplace: true, targetScope: true })\n .extend(marketplaceReadVisibilityField)\n .strict(),\n);\n\n/** Registry search returns compact metadata and a cursor for the next candidate page. */\nexport const marketplaceSearchResultSchema = z.lazy(() =>\n z.object({\n listings: z.array(\n marketplacePublicListingSchema._zod.innerType.pick({\n listingId: true,\n name: true,\n summary: true,\n publisherName: true,\n category: true,\n tags: true,\n latestVersion: true,\n featured: true,\n }),\n ),\n nextCursor: z.string().nullable(),\n hasNextPage: z.boolean(),\n }),\n);\n\n/** Search cursors advance through registry candidates, including pages without matches. */\nexport const marketplaceSearchInputSchema = z.lazy(() =>\n marketplaceListingPageInputSchema._zod.innerType.extend({\n query: z.string().trim().min(1).max(240),\n ...marketplaceReadVisibilityField,\n }),\n);\n\nexport const marketplacePublishedListingInputSchema = z.lazy(() =>\n z.object({\n listingId: marketplaceListingIdSchema,\n ...marketplaceVersionPageFields,\n }),\n);\n\nexport type MarketplacePublishedListingInput = z.input<\n typeof marketplacePublishedListingInputSchema\n>;\n\nexport const marketplaceViewInputSchema = z.lazy(() =>\n marketplacePublishedListingInputSchema._zod.innerType.extend(marketplaceReadVisibilityField),\n);\n\n/** A dry run writes nothing; accepted packages return their durable System workflow identity. */\nexport const marketplacePublishResultSchema = z.lazy(() =>\n z.discriminatedUnion(\"state\", [\n packageIdentitySchema._zod.innerType.extend({ state: z.literal(\"preview\") }),\n packageIdentitySchema._zod.innerType.extend({\n state: z.enum([\"requested\", \"published\"]),\n workflowInstanceId: z.string(),\n workflowScope: z.strictObject({ kind: z.literal(\"system\") }),\n }),\n ]),\n);\n\nexport type MarketplacePublishResult = z.output<typeof marketplacePublishResultSchema>;\n\n/** Publishing switches are enforced against the original caller, never the coordinator. */\nexport const marketplacePublishInputSchema = z.lazy(() =>\n z.strictObject({\n packageRoot: z\n .string()\n .trim()\n .min(1)\n .max(512)\n .refine(\n (path) =>\n path.startsWith(\"/\") &&\n path !== \"/\" &&\n !/[\\\\\\p{Cc}]/u.test(path) &&\n path\n .replace(/\\/$/u, \"\")\n .slice(1)\n .split(\"/\")\n .every((segment) => segment && segment !== \".\" && segment !== \"..\"),\n \"Marketplace package root must be an absolute directory path without traversal.\",\n )\n .transform((path) => path.replace(/\\/$/u, \"\"))\n .pipe(z.string()),\n visibility: marketplaceVisibilitySchema,\n dryRun: z.boolean().default(false),\n skipAuthorCheck: z.boolean().default(false),\n skipVersionCheck: z.boolean().default(false),\n }),\n);\n\n/** The workspace lock records one successful release per listing and installation folder. */\nexport const marketplaceLockSchema = z.lazy(() =>\n z\n .strictObject({\n entries: z.array(\n z.strictObject({\n // Locks written before organization Marketplaces existed only installed public listings.\n marketplace: marketplaceScopeSchema.default({ kind: \"system\" }),\n listingId: marketplaceListingIdSchema,\n version: marketplaceVersionSchema,\n installationRoot: marketplaceInstallationRootSchema,\n }),\n ),\n })\n .refine(\n (lock) =>\n new Set(\n lock.entries.map((entry) => JSON.stringify([entry.listingId, entry.installationRoot])),\n ).size === lock.entries.length,\n \"Marketplace lock entries must have unique listing and installation folder pairs.\",\n ),\n);\n\nexport const marketplaceListingDetailSchema = z.lazy(() =>\n z.object({\n listing: marketplacePublicListingSchema,\n versions: z.array(marketplaceVersionSchemaPublic),\n nextVersionCursor: z.string().optional(),\n hasNextVersionPage: z.boolean(),\n }),\n);\n\nexport type MarketplaceListingDetail = z.infer<typeof marketplaceListingDetailSchema>;\n\n/** Hidden entries belong to listings that are no longer published. */\nexport const marketplaceFeatureStateSchema = z.lazy(() =>\n z.enum([\"active\", \"scheduled\", \"expired\", \"hidden\"]),\n);\n\nexport type MarketplaceFeatureState = z.infer<typeof marketplaceFeatureStateSchema>;\n\n/** Curators see every entry with its state; browsers only see active entries. */\nexport const marketplaceFeatureEntrySchema = z.lazy(() =>\n z.object({\n listingId: marketplaceListingIdSchema,\n name: z.string(),\n state: marketplaceFeatureStateSchema,\n priority: z.number().int(),\n note: z.string().nullable(),\n startsAt: z.string(),\n until: z.string().nullable(),\n featuredBy: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n }),\n);\n\nexport type MarketplaceFeatureEntry = z.infer<typeof marketplaceFeatureEntrySchema>;\n\n/** Featuring an already featured listing replaces its window, priority, and note. */\nexport const marketplaceFeaturedResultSchema = z.lazy(() =>\n z.object({\n entries: z.array(marketplaceFeatureEntrySchema),\n limit: z.number().int(),\n }),\n);\n\nexport type MarketplaceFeaturedResult = z.infer<typeof marketplaceFeaturedResultSchema>;\n\nconst MARKETPLACE_CURATION_AUTHORITY =\n \"In System scope this curates the public Marketplace and requires a System administrator; in organization scope it curates that organization's Marketplace and requires an organization owner or admin.\";\n\nexport const marketplaceOperations = {\n \"marketplace.search\": {\n description:\n \"Search published package metadata in the public Marketplace, or in the current organization's Marketplace with organization visibility. Follow nextCursor while hasNextPage is true, even when a candidate page has no matches.\",\n permissions: [BACKOFFICE_PERMISSION.marketplace.read],\n input: marketplaceSearchInputSchema,\n output: marketplaceSearchResultSchema,\n },\n \"marketplace.view\": {\n description:\n \"Inspect published package metadata and cursor-paginated releases in the public Marketplace, or in the current organization's Marketplace with organization visibility.\",\n permissions: [BACKOFFICE_PERMISSION.marketplace.read],\n input: marketplaceViewInputSchema,\n output: marketplaceListingDetailSchema,\n },\n \"marketplace.publish\": {\n description:\n \"Publish a captured package from a root manifest.json containing name @<organization-slug>/<package-slug>. Public visibility publishes to the public Marketplace; organization visibility publishes to the owning organization's members-only Marketplace. Versions are immutable by default; System may explicitly replace them. Dry runs write nothing. Author and version overrides require System context.\",\n permissions: [BACKOFFICE_PERMISSION.marketplace.publish],\n input: marketplacePublishInputSchema,\n output: marketplacePublishResultSchema,\n },\n // Curation authority depends on the scope, so the runtime checks it beyond the read permission.\n \"marketplace.featured\": {\n description: `List every feature entry with its state: active, scheduled, expired, or hidden (the listing is no longer published). ${MARKETPLACE_CURATION_AUTHORITY}`,\n permissions: [BACKOFFICE_PERMISSION.marketplace.read],\n input: z.lazy(() => z.strictObject({})),\n output: marketplaceFeaturedResultSchema,\n },\n} satisfies Record<string, BackofficeApiOperation>;\n\nexport const packagesOperations = {\n \"packages.install\": {\n description:\n \"Start the existing Marketplace installation workflow in the current workspace at a required folder under /workspace. Installs from the public Marketplace, or from the installing organization's Marketplace with organization visibility. Installation is asynchronous. Installing another version at a folder that already holds the item upgrades it in place, replacing and removing files that still match the installed version; it fails without changes if a file it would replace was edited. Omit version to use the existing latest-release resolution.\",\n permissions: [BACKOFFICE_PERMISSION.packages.install],\n input: packagesInstallInputSchema,\n output: packagesInstallResultSchema,\n },\n \"packages.ls\": {\n description:\n \"List successful package installations recorded in /workspace/marketplace-lock.json for the current workspace. A missing lock is empty; malformed locks fail without being modified.\",\n permissions: [BACKOFFICE_PERMISSION.packages.read],\n input: z.lazy(() => z.strictObject({})),\n output: marketplaceLockSchema,\n },\n} satisfies Record<string, BackofficeApiOperation>;\n"],"mappings":";;;;AAUA,MAAa,uBAAuB,EAAE,WACpC,EACG,OAAO,CAAC,CACR,KAAK,CAAC,CACN,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,MAAM,+BAA+B,gDAAgD,CAC1F;AAEA,MAAa,2BAA2B,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;;AAGtF,MAAa,0CAA0C,EAAE,WACvD,EAAE,aAAa;CACb,MAAM,EAAE,QAAQ,KAAK;CACrB,OAAO;AACT,CAAC,CACH;AAEA,MAAM,kCAAkC,EAAE,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;CACP,WAAW;CACX,MAAM,EAAE,OAAO;CACf,OAAO;CACP,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI;CACzB,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,UAAU,EAAE,OAAO;CACnB,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,YAAY,EAAE,OAAO;CACrB,WAAW,EAAE,OAAO;CACpB,WAAW,EAAE,OAAO;AACtB,CAAC,CACH;;AAKA,MAAa,kCAAkC,EAAE,WAC/C,EAAE,OAAO;CACP,SAAS,EAAE,MAAM,6BAA6B;CAC9C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI;AACxB,CAAC,CACH;AAOA,MAAa,wBAAwB;CACnC,sBAAsB;EACpB,aACE;EACF,aAAa,CAAC,sBAAsB,YAAY,IAAI;EACpD,OAAO;EACP,QAAQ;CACV;CACA,oBAAoB;EAClB,aACE;EACF,aAAa,CAAC,sBAAsB,YAAY,IAAI;EACpD,OAAO;EACP,QAAQ;CACV;CACA,uBAAuB;EACrB,aACE;EACF,aAAa,CAAC,sBAAsB,YAAY,OAAO;EACvD,OAAO;EACP,QAAQ;CACV;CAEA,wBAAwB;EACtB,aAAa;EACb,aAAa,CAAC,sBAAsB,YAAY,IAAI;EACpD,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;EACtC,QAAQ;CACV;AACF;AAEA,MAAa,qBAAqB;CAChC,oBAAoB;EAClB,aACE;EACF,aAAa,CAAC,sBAAsB,SAAS,OAAO;EACpD,OAAO;EACP,QAAQ;CACV;CACA,eAAe;EACb,aACE;EACF,aAAa,CAAC,sBAAsB,SAAS,IAAI;EACjD,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;EACtC,QAAQ;CACV;AACF"}
@@ -0,0 +1,182 @@
1
+ import { z } from "zod";
2
+ //#region src/v0/organization.d.ts
3
+ declare const organizationRoleSchema: z.ZodLazy<z.ZodEnum<{
4
+ admin: "admin";
5
+ owner: "owner";
6
+ member: "member";
7
+ }>>;
8
+ type OrganizationRole = z.output<typeof organizationRoleSchema>;
9
+ declare const organizationRecordSchema: z.ZodLazy<z.ZodObject<{
10
+ organizationId: z.ZodString;
11
+ name: z.ZodString;
12
+ slug: z.ZodString;
13
+ createdAt: z.ZodISODateTime;
14
+ }, z.core.$strict>>;
15
+ type OrganizationRecord = z.output<typeof organizationRecordSchema>;
16
+ /** One user's membership: the organization and the roles that user holds in it. */
17
+ declare const organizationMembershipRecordSchema: z.ZodLazy<z.ZodObject<{
18
+ organization: z.ZodLazy<z.ZodObject<{
19
+ organizationId: z.ZodString;
20
+ name: z.ZodString;
21
+ slug: z.ZodString;
22
+ createdAt: z.ZodISODateTime;
23
+ }, z.core.$strict>>;
24
+ roles: z.ZodArray<z.ZodString>;
25
+ }, z.core.$strict>>;
26
+ type OrganizationMembershipRecord = z.output<typeof organizationMembershipRecordSchema>;
27
+ declare const organizationMemberPageSchema: z.ZodLazy<z.ZodObject<{
28
+ members: z.ZodArray<z.ZodLazy<z.ZodObject<{
29
+ userId: z.ZodString;
30
+ name: z.ZodString;
31
+ email: z.ZodString;
32
+ roles: z.ZodArray<z.ZodString>;
33
+ joinedAt: z.ZodISODateTime;
34
+ }, z.core.$strict>>>;
35
+ nextCursor: z.ZodNullable<z.ZodString>;
36
+ hasNextPage: z.ZodBoolean;
37
+ }, z.core.$strict>>;
38
+ type OrganizationMemberPage = z.output<typeof organizationMemberPageSchema>;
39
+ /** Only unexpired pending invitations are listed; accepted or expired ones are history. */
40
+ declare const organizationInvitationRecordSchema: z.ZodLazy<z.ZodObject<{
41
+ invitationId: z.ZodString;
42
+ organizationId: z.ZodString;
43
+ email: z.ZodString;
44
+ roles: z.ZodArray<z.ZodString>;
45
+ expiresAt: z.ZodISODateTime;
46
+ createdAt: z.ZodISODateTime;
47
+ }, z.core.$strict>>;
48
+ type OrganizationInvitationRecord = z.output<typeof organizationInvitationRecordSchema>;
49
+ /** Invitations are not emailed; the inviter shares this link. */
50
+ declare const organizationInvitationLinkSchema: z.ZodLazy<z.ZodObject<{
51
+ invitationId: z.ZodString;
52
+ organizationId: z.ZodString;
53
+ email: z.ZodString;
54
+ roles: z.ZodArray<z.ZodString>;
55
+ expiresAt: z.ZodISODateTime;
56
+ createdAt: z.ZodISODateTime;
57
+ url: z.ZodURL;
58
+ }, z.core.$strict>>;
59
+ type OrganizationInvitationLink = z.output<typeof organizationInvitationLinkSchema>;
60
+ declare const organizationInvitationLinkPageSchema: z.ZodLazy<z.ZodObject<{
61
+ invitations: z.ZodArray<z.ZodLazy<z.ZodObject<{
62
+ invitationId: z.ZodString;
63
+ organizationId: z.ZodString;
64
+ email: z.ZodString;
65
+ roles: z.ZodArray<z.ZodString>;
66
+ expiresAt: z.ZodISODateTime;
67
+ createdAt: z.ZodISODateTime;
68
+ url: z.ZodURL;
69
+ }, z.core.$strict>>>;
70
+ nextCursor: z.ZodNullable<z.ZodString>;
71
+ hasNextPage: z.ZodBoolean;
72
+ }, z.core.$strict>>;
73
+ type OrganizationInvitationLinkPage = z.output<typeof organizationInvitationLinkPageSchema>;
74
+ /** Organization operations act on the scoped organization as the calling user. */
75
+ declare const organizationOperations: {
76
+ "org.get": {
77
+ description: string;
78
+ permissions: {
79
+ readonly namespace: "org";
80
+ readonly permission: "read";
81
+ }[];
82
+ input: z.ZodVoid;
83
+ output: z.ZodLazy<z.ZodObject<{
84
+ organization: z.ZodLazy<z.ZodObject<{
85
+ organizationId: z.ZodString;
86
+ name: z.ZodString;
87
+ slug: z.ZodString;
88
+ createdAt: z.ZodISODateTime;
89
+ }, z.core.$strict>>;
90
+ roles: z.ZodArray<z.ZodString>;
91
+ }, z.core.$strict>>;
92
+ };
93
+ "org.update": {
94
+ description: string;
95
+ permissions: {
96
+ readonly namespace: "org";
97
+ readonly permission: "manage";
98
+ }[];
99
+ input: z.ZodLazy<z.ZodObject<{
100
+ name: z.ZodString;
101
+ }, z.core.$strict>>;
102
+ output: z.ZodLazy<z.ZodObject<{
103
+ organizationId: z.ZodString;
104
+ name: z.ZodString;
105
+ slug: z.ZodString;
106
+ createdAt: z.ZodISODateTime;
107
+ }, z.core.$strict>>;
108
+ };
109
+ "org.members.list": {
110
+ description: string;
111
+ permissions: {
112
+ readonly namespace: "org";
113
+ readonly permission: "read";
114
+ }[];
115
+ input: z.ZodLazy<z.ZodObject<{
116
+ pageSize: z.ZodDefault<z.ZodNumber>;
117
+ cursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
118
+ }, z.core.$strict>>;
119
+ output: z.ZodLazy<z.ZodObject<{
120
+ members: z.ZodArray<z.ZodLazy<z.ZodObject<{
121
+ userId: z.ZodString;
122
+ name: z.ZodString;
123
+ email: z.ZodString;
124
+ roles: z.ZodArray<z.ZodString>;
125
+ joinedAt: z.ZodISODateTime;
126
+ }, z.core.$strict>>>;
127
+ nextCursor: z.ZodNullable<z.ZodString>;
128
+ hasNextPage: z.ZodBoolean;
129
+ }, z.core.$strict>>;
130
+ };
131
+ "org.invitations.list": {
132
+ description: string;
133
+ permissions: {
134
+ readonly namespace: "org";
135
+ readonly permission: "read";
136
+ }[];
137
+ input: z.ZodLazy<z.ZodObject<{
138
+ pageSize: z.ZodDefault<z.ZodNumber>;
139
+ cursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
140
+ }, z.core.$strict>>;
141
+ output: z.ZodLazy<z.ZodObject<{
142
+ invitations: z.ZodArray<z.ZodLazy<z.ZodObject<{
143
+ invitationId: z.ZodString;
144
+ organizationId: z.ZodString;
145
+ email: z.ZodString;
146
+ roles: z.ZodArray<z.ZodString>;
147
+ expiresAt: z.ZodISODateTime;
148
+ createdAt: z.ZodISODateTime;
149
+ url: z.ZodURL;
150
+ }, z.core.$strict>>>;
151
+ nextCursor: z.ZodNullable<z.ZodString>;
152
+ hasNextPage: z.ZodBoolean;
153
+ }, z.core.$strict>>;
154
+ };
155
+ "org.invitations.create": {
156
+ description: string;
157
+ permissions: {
158
+ readonly namespace: "org";
159
+ readonly permission: "manage";
160
+ }[];
161
+ input: z.ZodLazy<z.ZodObject<{
162
+ email: z.ZodPipe<z.ZodString, z.ZodEmail>;
163
+ roles: z.ZodArray<z.ZodLazy<z.ZodEnum<{
164
+ admin: "admin";
165
+ owner: "owner";
166
+ member: "member";
167
+ }>>>;
168
+ }, z.core.$strict>>;
169
+ output: z.ZodLazy<z.ZodObject<{
170
+ invitationId: z.ZodString;
171
+ organizationId: z.ZodString;
172
+ email: z.ZodString;
173
+ roles: z.ZodArray<z.ZodString>;
174
+ expiresAt: z.ZodISODateTime;
175
+ createdAt: z.ZodISODateTime;
176
+ url: z.ZodURL;
177
+ }, z.core.$strict>>;
178
+ };
179
+ };
180
+ //#endregion
181
+ export { OrganizationInvitationLink, OrganizationInvitationLinkPage, OrganizationInvitationRecord, OrganizationMemberPage, OrganizationMembershipRecord, OrganizationRecord, OrganizationRole, organizationInvitationRecordSchema, organizationMemberPageSchema, organizationMembershipRecordSchema, organizationOperations, organizationRecordSchema, organizationRoleSchema };
182
+ //# sourceMappingURL=organization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.d.ts","names":[],"sources":["../../src/v0/organization.ts"],"mappings":";;cAMa,wBAAsB,EAAA,QAAA,EAAA;;;;;KACvB,mBAAmB,EAAE,cAAc;cAElC,0BAAwB,EAAA,QAAA,EAAA;;;;;;KAUzB,qBAAqB,EAAE,cAAc;;cAGpC,oCAAkC,EAAA,QAAA,EAAA;;;;;;;;;KAQnC,+BAA+B,EAAE,cAAc;cAc9C,8BAA4B,EAAA,QAAA,EAAA;;;;;;;;;;;KAS7B,yBAAyB,EAAE,cAAc;;cAGxC,oCAAkC,EAAA,QAAA,EAAA;;;;;;;;KAYnC,+BAA+B,EAAE,cAAc;;cAGrD,kCAAgC,EAAA,QAAA,EAAA;;;;;;;;;KAG1B,6BAA6B,EAAE,cAAc;cAEnD,sCAAoC,EAAA,QAAA,EAAA;;;;;;;;;;;;;KAS9B,iCAAiC,EAAE,cAAc;;cAGhD"}
@@ -0,0 +1,88 @@
1
+ import { directoryPageInputSchema } from "./shared/pagination.js";
2
+ import { BACKOFFICE_PERMISSION } from "./shared/permissions.js";
3
+ import { z } from "zod";
4
+ //#region src/v0/organization.ts
5
+ const organizationRoleSchema = z.lazy(() => z.enum([
6
+ "owner",
7
+ "admin",
8
+ "member"
9
+ ]));
10
+ const organizationRecordSchema = z.lazy(() => z.strictObject({
11
+ organizationId: z.string().min(1),
12
+ name: z.string().min(1),
13
+ slug: z.string().min(1),
14
+ createdAt: z.iso.datetime()
15
+ })).meta({ id: "OrganizationRecord" });
16
+ /** One user's membership: the organization and the roles that user holds in it. */
17
+ const organizationMembershipRecordSchema = z.lazy(() => z.strictObject({
18
+ organization: organizationRecordSchema,
19
+ roles: z.array(z.string().min(1)).min(1)
20
+ })).meta({ id: "OrganizationMembershipRecord" });
21
+ const organizationMemberRecordSchema = z.lazy(() => z.strictObject({
22
+ userId: z.string().min(1),
23
+ name: z.string(),
24
+ email: z.string().min(1),
25
+ roles: z.array(z.string().min(1)).min(1),
26
+ joinedAt: z.iso.datetime()
27
+ })).meta({ id: "OrganizationMemberRecord" });
28
+ const organizationMemberPageSchema = z.lazy(() => z.strictObject({
29
+ members: z.array(organizationMemberRecordSchema),
30
+ nextCursor: z.string().nullable(),
31
+ hasNextPage: z.boolean()
32
+ })).meta({ id: "OrganizationMemberPage" });
33
+ /** Only unexpired pending invitations are listed; accepted or expired ones are history. */
34
+ const organizationInvitationRecordSchema = z.lazy(() => z.strictObject({
35
+ invitationId: z.string().min(1),
36
+ organizationId: z.string().min(1),
37
+ email: z.string().min(1),
38
+ roles: z.array(z.string().min(1)).min(1),
39
+ expiresAt: z.iso.datetime(),
40
+ createdAt: z.iso.datetime()
41
+ })).meta({ id: "OrganizationInvitationRecord" });
42
+ /** Invitations are not emailed; the inviter shares this link. */
43
+ const organizationInvitationLinkSchema = z.lazy(() => organizationInvitationRecordSchema._zod.innerType.extend({ url: z.url() })).meta({ id: "OrganizationInvitationLink" });
44
+ const organizationInvitationLinkPageSchema = z.lazy(() => z.strictObject({
45
+ invitations: z.array(organizationInvitationLinkSchema),
46
+ nextCursor: z.string().nullable(),
47
+ hasNextPage: z.boolean()
48
+ })).meta({ id: "OrganizationInvitationLinkPage" });
49
+ /** Organization operations act on the scoped organization as the calling user. */
50
+ const organizationOperations = {
51
+ "org.get": {
52
+ description: "Read the current organization and your roles in it.",
53
+ permissions: [BACKOFFICE_PERMISSION.org.read],
54
+ input: z.void(),
55
+ output: organizationMembershipRecordSchema
56
+ },
57
+ "org.update": {
58
+ description: "Rename the current organization. Requires the owner or admin role.",
59
+ permissions: [BACKOFFICE_PERMISSION.org.manage],
60
+ input: z.lazy(() => z.strictObject({ name: z.string().trim().min(1) })),
61
+ output: organizationRecordSchema
62
+ },
63
+ "org.members.list": {
64
+ description: "List members of the current organization with their roles, using cursor pagination.",
65
+ permissions: [BACKOFFICE_PERMISSION.org.read],
66
+ input: directoryPageInputSchema,
67
+ output: organizationMemberPageSchema
68
+ },
69
+ "org.invitations.list": {
70
+ description: "List pending, unexpired invitations to the current organization with their shareable links, using cursor pagination.",
71
+ permissions: [BACKOFFICE_PERMISSION.org.read],
72
+ input: directoryPageInputSchema,
73
+ output: organizationInvitationLinkPageSchema
74
+ },
75
+ "org.invitations.create": {
76
+ description: "Invite an email address to the current organization and return a shareable link. Invitations are not emailed. Requires the owner or admin role; only owners may invite owners.",
77
+ permissions: [BACKOFFICE_PERMISSION.org.manage],
78
+ input: z.lazy(() => z.strictObject({
79
+ email: z.string().trim().toLowerCase().pipe(z.email()),
80
+ roles: z.array(organizationRoleSchema).min(1)
81
+ })),
82
+ output: organizationInvitationLinkSchema
83
+ }
84
+ };
85
+ //#endregion
86
+ export { organizationInvitationRecordSchema, organizationMemberPageSchema, organizationMembershipRecordSchema, organizationOperations, organizationRecordSchema, organizationRoleSchema };
87
+
88
+ //# sourceMappingURL=organization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.js","names":[],"sources":["../../src/v0/organization.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { BackofficeApiOperation } from \"../api\";\nimport { directoryPageInputSchema } from \"./shared/pagination\";\nimport { BACKOFFICE_PERMISSION } from \"./shared/permissions\";\n\nexport const organizationRoleSchema = z.lazy(() => z.enum([\"owner\", \"admin\", \"member\"]));\nexport type OrganizationRole = z.output<typeof organizationRoleSchema>;\n\nexport const organizationRecordSchema = z\n .lazy(() =>\n z.strictObject({\n organizationId: z.string().min(1),\n name: z.string().min(1),\n slug: z.string().min(1),\n createdAt: z.iso.datetime(),\n }),\n )\n .meta({ id: \"OrganizationRecord\" });\nexport type OrganizationRecord = z.output<typeof organizationRecordSchema>;\n\n/** One user's membership: the organization and the roles that user holds in it. */\nexport const organizationMembershipRecordSchema = z\n .lazy(() =>\n z.strictObject({\n organization: organizationRecordSchema,\n roles: z.array(z.string().min(1)).min(1),\n }),\n )\n .meta({ id: \"OrganizationMembershipRecord\" });\nexport type OrganizationMembershipRecord = z.output<typeof organizationMembershipRecordSchema>;\n\nconst organizationMemberRecordSchema = z\n .lazy(() =>\n z.strictObject({\n userId: z.string().min(1),\n name: z.string(),\n email: z.string().min(1),\n roles: z.array(z.string().min(1)).min(1),\n joinedAt: z.iso.datetime(),\n }),\n )\n .meta({ id: \"OrganizationMemberRecord\" });\n\nexport const organizationMemberPageSchema = z\n .lazy(() =>\n z.strictObject({\n members: z.array(organizationMemberRecordSchema),\n nextCursor: z.string().nullable(),\n hasNextPage: z.boolean(),\n }),\n )\n .meta({ id: \"OrganizationMemberPage\" });\nexport type OrganizationMemberPage = z.output<typeof organizationMemberPageSchema>;\n\n/** Only unexpired pending invitations are listed; accepted or expired ones are history. */\nexport const organizationInvitationRecordSchema = z\n .lazy(() =>\n z.strictObject({\n invitationId: z.string().min(1),\n organizationId: z.string().min(1),\n email: z.string().min(1),\n roles: z.array(z.string().min(1)).min(1),\n expiresAt: z.iso.datetime(),\n createdAt: z.iso.datetime(),\n }),\n )\n .meta({ id: \"OrganizationInvitationRecord\" });\nexport type OrganizationInvitationRecord = z.output<typeof organizationInvitationRecordSchema>;\n\n/** Invitations are not emailed; the inviter shares this link. */\nconst organizationInvitationLinkSchema = z\n .lazy(() => organizationInvitationRecordSchema._zod.innerType.extend({ url: z.url() }))\n .meta({ id: \"OrganizationInvitationLink\" });\nexport type OrganizationInvitationLink = z.output<typeof organizationInvitationLinkSchema>;\n\nconst organizationInvitationLinkPageSchema = z\n .lazy(() =>\n z.strictObject({\n invitations: z.array(organizationInvitationLinkSchema),\n nextCursor: z.string().nullable(),\n hasNextPage: z.boolean(),\n }),\n )\n .meta({ id: \"OrganizationInvitationLinkPage\" });\nexport type OrganizationInvitationLinkPage = z.output<typeof organizationInvitationLinkPageSchema>;\n\n/** Organization operations act on the scoped organization as the calling user. */\nexport const organizationOperations = {\n \"org.get\": {\n description: \"Read the current organization and your roles in it.\",\n permissions: [BACKOFFICE_PERMISSION.org.read],\n input: z.void(),\n output: organizationMembershipRecordSchema,\n },\n \"org.update\": {\n description: \"Rename the current organization. Requires the owner or admin role.\",\n permissions: [BACKOFFICE_PERMISSION.org.manage],\n input: z.lazy(() => z.strictObject({ name: z.string().trim().min(1) })),\n output: organizationRecordSchema,\n },\n \"org.members.list\": {\n description:\n \"List members of the current organization with their roles, using cursor pagination.\",\n permissions: [BACKOFFICE_PERMISSION.org.read],\n input: directoryPageInputSchema,\n output: organizationMemberPageSchema,\n },\n \"org.invitations.list\": {\n description:\n \"List pending, unexpired invitations to the current organization with their shareable links, using cursor pagination.\",\n permissions: [BACKOFFICE_PERMISSION.org.read],\n input: directoryPageInputSchema,\n output: organizationInvitationLinkPageSchema,\n },\n \"org.invitations.create\": {\n description:\n \"Invite an email address to the current organization and return a shareable link. Invitations are not emailed. Requires the owner or admin role; only owners may invite owners.\",\n permissions: [BACKOFFICE_PERMISSION.org.manage],\n input: z.lazy(() =>\n z.strictObject({\n email: z.string().trim().toLowerCase().pipe(z.email()),\n roles: z.array(organizationRoleSchema).min(1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