@dork-labs/cloud-api 0.81.0 → 0.82.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 (53) hide show
  1. package/README.md +51 -1
  2. package/dist/billing.d.ts +26 -2
  3. package/dist/billing.d.ts.map +1 -1
  4. package/dist/billing.js +37 -0
  5. package/dist/billing.js.map +1 -1
  6. package/dist/communities.d.ts +706 -0
  7. package/dist/communities.d.ts.map +1 -0
  8. package/dist/communities.js +578 -0
  9. package/dist/communities.js.map +1 -0
  10. package/dist/connections.d.ts +3 -3
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/primitives.d.ts +49 -0
  16. package/dist/primitives.d.ts.map +1 -1
  17. package/dist/primitives.js +63 -0
  18. package/dist/primitives.js.map +1 -1
  19. package/dist/problem.d.ts +15 -0
  20. package/dist/problem.d.ts.map +1 -1
  21. package/dist/problem.js +22 -1
  22. package/dist/problem.js.map +1 -1
  23. package/dist/remote.d.ts +2 -2
  24. package/dist/routes.d.ts +43 -0
  25. package/dist/routes.d.ts.map +1 -1
  26. package/dist/routes.js +65 -0
  27. package/dist/routes.js.map +1 -1
  28. package/dist/seats.d.ts +5 -5
  29. package/fixtures/v1/billing/entitlements-communities.json +40 -0
  30. package/fixtures/v1/communities/claim-link.json +5 -0
  31. package/fixtures/v1/communities/keep-request.json +3 -0
  32. package/fixtures/v1/communities/keep.json +34 -0
  33. package/fixtures/v1/communities/list.json +161 -0
  34. package/fixtures/v1/communities/move-cancelled.json +11 -0
  35. package/fixtures/v1/communities/move-claimed.json +19 -0
  36. package/fixtures/v1/communities/move-failed.json +11 -0
  37. package/fixtures/v1/communities/move-importing.json +19 -0
  38. package/fixtures/v1/communities/move-ready.json +19 -0
  39. package/fixtures/v1/communities/move-start-request.json +7 -0
  40. package/fixtures/v1/communities/move-start.json +20 -0
  41. package/fixtures/v1/communities/moves.json +35 -0
  42. package/fixtures/v1/communities/name-check-free.json +5 -0
  43. package/fixtures/v1/communities/name-check-taken.json +5 -0
  44. package/fixtures/v1/communities/restore.json +31 -0
  45. package/fixtures/v1/communities/start-replay.json +31 -0
  46. package/fixtures/v1/communities/start-request.json +5 -0
  47. package/fixtures/v1/communities/start.json +35 -0
  48. package/fixtures/v1/index.json +24 -1
  49. package/fixtures/v1/problem/community-name-reserved.json +5 -0
  50. package/fixtures/v1/problem/community-name-taken.json +5 -0
  51. package/fixtures/v1/problem/entitlement-required-action.json +8 -0
  52. package/fixtures/v1/problem/import-too-large.json +6 -0
  53. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communities.d.ts","sourceRoot":"","sources":["../src/communities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkCxB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,aAQlC,CAAC;AAgCJ;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;EAYpC,CAAC;AAEJ,oDAAoD;AACpD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,+BAA+B;;;;EAIzC,CAAC;AAEJ,yCAAyC;AACzC,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B;;;;;iBAiBuD,CAAC;AAEhG;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B;;;iBAOkD,CAAC;AAE/F;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiGiE,CAAC;AAEpG,2CAA2C;AAC3C,MAA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K,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,EAAG,kBAA2B,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB;;;;;iBAU2C,CAAC;AAElF,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBsC,CAAC;AAEpF,wBAAwB;AACxB,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -0,0 +1,578 @@
1
+ import { z } from 'zod';
2
+ import { HttpsUrlSchema, IdSchema, ONE_TIME_CREDENTIAL_META, SecretValueSchema, ServerUrlSchema, TimestampSchema, pageOf, tolerantEnum, } from './primitives.js';
3
+ /*
4
+ * Hosted communities: the `/v1/communities` family.
5
+ *
6
+ * A hosted community is an ordinary DorkOS Community that a hosting service
7
+ * runs on a Community server for the caller. This contract says how the DorkOS
8
+ * app starts one, moves one in from an owner export, finds the ones the caller
9
+ * already has, and gets past a hold. It says nothing about which host runs a
10
+ * community, what hosting costs, or how a service decides who may start one:
11
+ * the address a community lives at is a runtime value in every response, and a
12
+ * refusal a larger allowance would lift is `entitlement_required` with the
13
+ * service's own words and an `actionUrl` to open.
14
+ *
15
+ * The service never becomes a community's owner. Ownership moves to a person
16
+ * through the Community server's single-use owner claim. The claim link and a
17
+ * move's upload token are the only credentials this family returns; both carry
18
+ * the ONE_TIME_CREDENTIAL_META marker, and a test pins where they may appear.
19
+ *
20
+ * Idempotency keys are scoped to the caller: two people who happen to pick the
21
+ * same key never see each other's answer.
22
+ */
23
+ /**
24
+ * The grammar every community short name obeys.
25
+ *
26
+ * A short name is the optional address alias a Community server gives a
27
+ * community beside its permanent identifier. The grammar is the Community
28
+ * server's own: lower-case ASCII letters, digits and single hyphens, starting
29
+ * with a letter and not ending with a hyphen. Published so the app can refuse a
30
+ * bad name before a request goes out. Whether a well-formed name is free, or
31
+ * reserved by the host, only the service can say
32
+ * ({@link CommunityNameCheckResponseSchema}).
33
+ *
34
+ * Lower case by grammar, like `HandleSchema`: the app folds what a person
35
+ * types before sending it, and the service refuses a mixed-case name rather
36
+ * than folding it silently.
37
+ */
38
+ export const CommunityShortNameSchema = z
39
+ .string()
40
+ .regex(/^[a-z](?:[a-z0-9]|-(?=[a-z0-9])){2,31}$/, 'must be lower-case letters, digits and single hyphens, start with a letter, and not end with a hyphen')
41
+ .describe('A community short name: lower case, 3 to 32 characters, letters, digits and single hyphens, starting with a letter and not ending with a hyphen.');
42
+ /** A community's display name, as a person typed it. */
43
+ const CommunityNameSchema = z
44
+ .string()
45
+ .trim()
46
+ .min(1)
47
+ .max(80)
48
+ .describe('The community`s display name. Trimmed, 1 to 80 characters.');
49
+ /** The caller-chosen key that makes a start or a move safe to retry. */
50
+ const IdempotencyKeySchema = z
51
+ .string()
52
+ .min(1)
53
+ .max(200)
54
+ .describe('A key the caller chooses, scoped to the caller. Sending it again returns the same community or move instead of making a second one.');
55
+ /**
56
+ * A link that carries a single-use credential.
57
+ *
58
+ * A server link (`https:`, or `http:` to loopback for local use, since the
59
+ * link points at the Community server), marked with {@link ONE_TIME_CREDENTIAL_META} so a relay can
60
+ * refuse to pass it on and a test can pin where it appears.
61
+ *
62
+ * @param description - What the link is for.
63
+ */
64
+ function oneTimeLink(description) {
65
+ return ServerUrlSchema.meta({ description, [ONE_TIME_CREDENTIAL_META]: true });
66
+ }
67
+ /**
68
+ * Where a hosted community is in its lifecycle.
69
+ *
70
+ * Mechanism: the Community server's own lifecycle names, plus `provisioning`
71
+ * for the moment between the service accepting a start and the server
72
+ * confirming it. A community a person has not yet claimed is `pending_owner`.
73
+ * A community that no longer exists does not appear at all.
74
+ */
75
+ export const HostedCommunityStateSchema = z
76
+ .enum([
77
+ 'provisioning',
78
+ 'pending_owner',
79
+ 'active',
80
+ 'archived',
81
+ 'held',
82
+ 'suspended',
83
+ 'deletion_pending',
84
+ ])
85
+ .describe('Where a hosted community is in its lifecycle. The Community server`s own lifecycle names, plus provisioning while the server confirms a start.');
86
+ /**
87
+ * Why a hosted community is on hold.
88
+ *
89
+ * A hold makes a community read-only: people can read it and its owner can
90
+ * export it, and nothing new can be written. The reason tells the app which
91
+ * way out to offer.
92
+ *
93
+ * - `over_limit`: the account holds more than its allowance covers. Choosing
94
+ * which communities to keep, or a larger allowance, lifts it.
95
+ * - `inactive`: the service paused a community nobody has posted in for a long
96
+ * time. Restoring it lifts it, when it fits the account's allowance.
97
+ * - `host`: the host placed the hold for its own reasons. The owner cannot lift
98
+ * it from the app; the community's `notice` says who to contact.
99
+ */
100
+ export const HostedCommunityHoldReasonSchema = z
101
+ .enum(['over_limit', 'inactive', 'host'])
102
+ .describe('Why a hosted community is on hold: the account holds more than its allowance covers, nobody has posted in a long time, or the host placed the hold itself.');
103
+ /**
104
+ * What the service wants the owner to read about a community, in its own words.
105
+ *
106
+ * The app shows `title` and `detail` as given and, when present, a button that
107
+ * opens `actionUrl`. It is how a host hold, a suspension or a planned deletion
108
+ * is explained honestly without this contract enumerating every reason a host
109
+ * might have. A malformed link or label is dropped, like the one on `Problem`,
110
+ * so a bad link never costs the owner the notice itself.
111
+ */
112
+ export const HostedCommunityNoticeSchema = z
113
+ .object({
114
+ title: z.string().min(1).max(120).describe('A short summary, safe to show a person.'),
115
+ detail: z.string().max(2000).describe('The explanation, safe to show a person.'),
116
+ actionUrl: HttpsUrlSchema.optional()
117
+ .catch(undefined)
118
+ .describe('A page where the owner can act on the notice. Open it as given. A malformed value is dropped.'),
119
+ actionLabel: z
120
+ .string()
121
+ .min(1)
122
+ .max(60)
123
+ .optional()
124
+ .catch(undefined)
125
+ .describe('The text for a button that opens `actionUrl`. A malformed value is dropped.'),
126
+ })
127
+ .describe('What the service wants the owner to read about this community, in its own words.');
128
+ /**
129
+ * Whether the owner may keep this community open, and what that would cost.
130
+ *
131
+ * `wouldHold` is the preview the app shows before the owner confirms: keeping
132
+ * this community can put others on hold. The keep request echoes it back as
133
+ * `expectedHeldCommunityIds`, so a choice made against a stale preview is
134
+ * refused rather than holding a community nobody was warned about.
135
+ */
136
+ export const HostedCommunityKeepActionSchema = z
137
+ .object({
138
+ allowed: z.boolean().describe('The owner may choose this community as one to keep open.'),
139
+ wouldHold: z
140
+ .array(IdSchema)
141
+ .describe('The caller`s other communities that keeping this one would put on hold.'),
142
+ })
143
+ .describe('Whether the owner may keep this community open, and which others it would hold.');
144
+ /**
145
+ * One community the caller has hosted.
146
+ *
147
+ * `limits` and `usage` are numbers, never a plan: the app says "this community
148
+ * is full" from them without knowing what the caller bought. `actions` is the
149
+ * service's answer to "what may this person do next", so the app renders a
150
+ * button only when the service will accept it and never re-derives the rule.
151
+ * A new action arrives as a new optional field of `actions`.
152
+ *
153
+ * A `held` community always says why (`hold`), and one in `deletion_pending`
154
+ * always says when (`deletionAt`). The rules run one way only: a later release
155
+ * may carry a hold into another state (a held community whose deletion has
156
+ * started, for instance), and that must still parse.
157
+ *
158
+ * `state` and `hold.reason` are tolerant: a value added in a later release
159
+ * reads as `unrecognised` rather than failing the page it arrives in.
160
+ */
161
+ export const HostedCommunitySchema = z
162
+ .object({
163
+ communityId: IdSchema.describe('The community`s permanent identifier on its Community server. Never changes, even across a rename.'),
164
+ orgId: IdSchema.describe('The organization whose account this community belongs to.'),
165
+ name: z.string().min(1).max(80).describe('The community`s display name.'),
166
+ shortName: CommunityShortNameSchema.nullable().describe('The community`s current short name, or null when it has none.'),
167
+ communityUrl: ServerUrlSchema.describe('The community`s canonical link on its Community server, built on its permanent identifier. A runtime value; pair a DorkOS installation with this.'),
168
+ state: tolerantEnum(HostedCommunityStateSchema).describe('Where the community is in its lifecycle. A state this release does not know reads as unrecognised.'),
169
+ hold: z
170
+ .object({
171
+ reason: tolerantEnum(HostedCommunityHoldReasonSchema).describe('Why the community is on hold. A reason this release does not know reads as unrecognised.'),
172
+ since: TimestampSchema,
173
+ deletionNoticeAt: TimestampSchema.nullable().describe('When the host may delete the community if the hold is not lifted, or null when no deletion is planned. The owner can export until then.'),
174
+ })
175
+ .nullable()
176
+ .describe('Why and since when the community is on hold. Always set when the state is held.'),
177
+ deletionAt: TimestampSchema.nullable().describe('When the Community server will delete the community for good. Always set when the state is deletion_pending.'),
178
+ notice: HostedCommunityNoticeSchema.nullable().describe('What the service wants the owner to read about this community, or null when there is nothing.'),
179
+ kept: z
180
+ .boolean()
181
+ .describe('True when the owner chose this community to stay open while the account holds more communities than its allowance covers.'),
182
+ moveId: IdSchema.nullable().describe('The move filling this community from an owner export, while that move is unfinished. Null otherwise. Lets the app pick up a move after a restart.'),
183
+ limits: z
184
+ .object({
185
+ maxActiveMembers: z
186
+ .number()
187
+ .int()
188
+ .positive()
189
+ .nullable()
190
+ .describe('The most people who may be active members at once. Null means no limit.'),
191
+ maxStorageBytes: z
192
+ .number()
193
+ .int()
194
+ .nonnegative()
195
+ .nullable()
196
+ .describe('The most bytes of files the community may store. Null means no per-community limit.'),
197
+ })
198
+ .describe('The limits the host enforces on this community. Agents and history never count.'),
199
+ usage: z
200
+ .object({
201
+ activeMembers: z.number().int().nonnegative(),
202
+ storageBytes: z
203
+ .number()
204
+ .int()
205
+ .nonnegative()
206
+ .describe('The bytes that count against the storage limit. Owner exports never count.'),
207
+ measuredAt: TimestampSchema,
208
+ })
209
+ .nullable()
210
+ .describe('The community`s last measured usage, or null before the first measurement.'),
211
+ actions: z
212
+ .object({
213
+ claimLink: z
214
+ .boolean()
215
+ .describe('The service will issue a fresh owner-claim link for this community.'),
216
+ keep: HostedCommunityKeepActionSchema,
217
+ restore: z.boolean().describe('The owner may ask for this held community to reopen.'),
218
+ })
219
+ .describe('What the caller may do next. Render an action only when it is allowed; the service applies the rule, the app never re-derives it.'),
220
+ createdAt: TimestampSchema,
221
+ })
222
+ .superRefine((community, ctx) => {
223
+ if (community.state === 'held' && community.hold === null) {
224
+ ctx.addIssue({ code: 'custom', path: ['hold'], message: 'a held community says why' });
225
+ }
226
+ if (community.state === 'deletion_pending' && community.deletionAt === null) {
227
+ ctx.addIssue({
228
+ code: 'custom',
229
+ path: ['deletionAt'],
230
+ message: 'a community pending deletion says when',
231
+ });
232
+ }
233
+ })
234
+ .describe('One community the caller has hosted, with its state, limits and usage. Numbers only.');
235
+ /**
236
+ * `GET /v1/communities` — the caller's hosted communities.
237
+ *
238
+ * Every community the caller owns or started, across every organization they
239
+ * belong to, in no particular order. The app reads it to show what the caller
240
+ * already has, to finish a claim or a move after a restart, and to offer the
241
+ * way out of a hold.
242
+ */
243
+ export const HostedCommunityListResponseSchema = pageOf(HostedCommunitySchema, 'A page of the communities the caller has hosted.');
244
+ /** `GET /v1/communities/name-check` query parameters. */
245
+ export const CommunityNameCheckQuerySchema = z
246
+ .object({ name: CommunityShortNameSchema })
247
+ .describe('The short name to check.');
248
+ /**
249
+ * Why a well-formed short name cannot be used.
250
+ *
251
+ * Mechanism, and the same two answers the start and move routes refuse with as
252
+ * `community_name_taken` and `community_name_reserved`. `taken` includes a name
253
+ * another community used recently and that is still held back.
254
+ */
255
+ export const CommunityNameUnavailableReasonSchema = z
256
+ .enum(['taken', 'reserved'])
257
+ .describe('Why a short name cannot be used: another community has it, or the host reserves it.');
258
+ /**
259
+ * `GET /v1/communities/name-check` — is this short name free right now?
260
+ *
261
+ * Advisory: it lets the start form say "That web address is taken" while a
262
+ * person types. The start and move routes check again and are the only answer
263
+ * that binds, so a name free here can still be refused a moment later.
264
+ * `reason` is null exactly when `available` is true.
265
+ */
266
+ export const CommunityNameCheckResponseSchema = z
267
+ .object({
268
+ name: CommunityShortNameSchema,
269
+ available: z.boolean(),
270
+ reason: CommunityNameUnavailableReasonSchema.nullable().describe('Why the name cannot be used. Null exactly when it is available.'),
271
+ })
272
+ .superRefine((check, ctx) => {
273
+ if (check.available !== (check.reason === null)) {
274
+ ctx.addIssue({
275
+ code: 'custom',
276
+ path: ['reason'],
277
+ message: 'reason is null exactly when the name is available',
278
+ });
279
+ }
280
+ })
281
+ .describe('Whether a short name is free right now. Advisory; starting a community checks again.');
282
+ /**
283
+ * `POST /v1/communities` — start a hosted community.
284
+ *
285
+ * Idempotent on `idempotencyKey`, scoped to the caller: the same key with the
286
+ * same body returns the same community (with `replayed: true`) rather than
287
+ * starting a second one, and the same key with a different body is refused
288
+ * with `conflict`. A refusal a larger allowance would lift is
289
+ * `entitlement_required`; a short name that cannot be used is
290
+ * `community_name_taken` or `community_name_reserved`.
291
+ */
292
+ export const CommunityStartRequestSchema = z
293
+ .object({
294
+ idempotencyKey: IdempotencyKeySchema,
295
+ name: CommunityNameSchema,
296
+ shortName: CommunityShortNameSchema.optional().describe('The short name to give the community. Omitted means none.'),
297
+ orgId: IdSchema.optional().describe('The organization whose account the community belongs to. Omitted means the caller`s personal one.'),
298
+ })
299
+ .describe('Start a hosted community. Idempotent on the caller`s key.');
300
+ /**
301
+ * A one-time link that makes a person the owner of a new community.
302
+ *
303
+ * The link carries a single-use credential. Open it in the person's own
304
+ * browser, never log it, and never show it to anyone else. Issuing a fresh one
305
+ * revokes the last.
306
+ */
307
+ export const CommunityClaimLinkSchema = z
308
+ .object({
309
+ communityId: IdSchema,
310
+ claimUrl: oneTimeLink('The owner-claim link. A single-use credential: open it in the person`s own browser and never log it.'),
311
+ expiresAt: TimestampSchema.describe('When the link stops working.'),
312
+ })
313
+ .describe('A one-time link that makes a person the owner of a new community. Returned once.');
314
+ /**
315
+ * The started community.
316
+ *
317
+ * The first answer carries the claim link, and no later answer does: the link
318
+ * is a single-use credential and the service keeps no copy it could return
319
+ * again. `claim` is therefore null when `replayed` is true, and also while the
320
+ * community is still `provisioning` (the Community server has not confirmed
321
+ * it yet). In both cases the app waits for `pending_owner` in the list and
322
+ * asks `POST /v1/communities/{communityId}/claim-link` for a link.
323
+ */
324
+ export const CommunityStartResponseSchema = z
325
+ .object({
326
+ community: HostedCommunitySchema,
327
+ claim: CommunityClaimLinkSchema.nullable().describe('The owner-claim link, or null when this answer repeats an earlier request or the community is still provisioning.'),
328
+ replayed: z
329
+ .boolean()
330
+ .describe('True when this answer repeats an earlier request with the same key.'),
331
+ })
332
+ .superRefine((started, ctx) => {
333
+ if (started.claim !== null &&
334
+ (started.replayed || started.community.state !== 'pending_owner')) {
335
+ ctx.addIssue({
336
+ code: 'custom',
337
+ path: ['claim'],
338
+ message: 'a claim link comes only on the first answer, for a pending_owner community',
339
+ });
340
+ }
341
+ })
342
+ .describe('The started community and, the first time only, its owner-claim link.');
343
+ /**
344
+ * `POST /v1/communities/{communityId}/keep` — the request.
345
+ *
346
+ * `expectedHeldCommunityIds` is the `actions.keep.wouldHold` preview the owner
347
+ * confirmed. When the service would now hold a different set, it refuses with
348
+ * `conflict` and holds nothing, so the app refreshes the list and asks again.
349
+ */
350
+ export const CommunityKeepRequestSchema = z
351
+ .object({
352
+ expectedHeldCommunityIds: z
353
+ .array(IdSchema)
354
+ .describe('The communities the owner was told this choice would hold, in any order.'),
355
+ })
356
+ .describe('Keep this community open, confirming which others the owner agreed to hold.');
357
+ /**
358
+ * `POST /v1/communities/{communityId}/keep` — keep this community open.
359
+ *
360
+ * For an account that holds more communities than its allowance covers: the
361
+ * owner chooses which stay open. The answer names every other community the
362
+ * choice put on hold, which is exactly the confirmed preview. When no choice
363
+ * would make room, the refusal is `entitlement_required` with the service's
364
+ * own words and an `actionUrl`.
365
+ */
366
+ export const CommunityKeepResponseSchema = z
367
+ .object({
368
+ community: HostedCommunitySchema,
369
+ heldCommunityIds: z
370
+ .array(IdSchema)
371
+ .describe('Other communities of the caller`s that this choice put on hold. Often empty.'),
372
+ })
373
+ .describe('The kept community, and every other community the choice put on hold.');
374
+ /**
375
+ * Where a move is.
376
+ *
377
+ * Mechanism: the stages of reading an owner export into a new community.
378
+ * `ready` means the history is in and the community waits for its owner to
379
+ * claim it; `claimed` means they have.
380
+ */
381
+ export const CommunityMoveStateSchema = z
382
+ .enum(['awaiting_upload', 'importing', 'ready', 'failed', 'cancelled', 'claimed'])
383
+ .describe('Where a move is: waiting for the export, importing it, ready to claim, or finished.');
384
+ /**
385
+ * Why a move failed, in terms a person can act on.
386
+ *
387
+ * Mechanism, one member per thing the app says differently:
388
+ *
389
+ * - `not_owner_export`: the file is a personal export, not the owner's.
390
+ * - `archive_invalid`: the file is damaged or not a community export at all.
391
+ * - `checksum_mismatch`: a file inside the export does not match the export's
392
+ * own record of it, so the export itself is damaged. Export again.
393
+ * - `version_unsupported`: the export is from a version this host cannot read.
394
+ * - `too_large`: the export is larger than any single move may be.
395
+ * - `storage_limit_reached`: the files do not fit the community's storage limit.
396
+ * - `upload_expired`: the export did not arrive before the upload window closed.
397
+ * - `storage_unavailable`: the host could not store the files. Trying again later may work.
398
+ *
399
+ * An upload whose bytes do not match the declared size or digest is not a
400
+ * failure of the move: the upload is refused and the move stays
401
+ * `awaiting_upload` (see {@link CommunityMoveUploadSchema}). An upload window
402
+ * that closes before a matching file arrives is `upload_expired`.
403
+ */
404
+ export const CommunityMoveFailureCodeSchema = z
405
+ .enum([
406
+ 'not_owner_export',
407
+ 'archive_invalid',
408
+ 'checksum_mismatch',
409
+ 'version_unsupported',
410
+ 'too_large',
411
+ 'storage_limit_reached',
412
+ 'upload_expired',
413
+ 'storage_unavailable',
414
+ ])
415
+ .describe('Why a move failed, in terms a person can act on.');
416
+ /**
417
+ * What an owner export holds, measured before anything is restored.
418
+ *
419
+ * Counts and sizes only. No channel name, file name, person or text ever
420
+ * appears here.
421
+ */
422
+ export const CommunityMoveReportSchema = z
423
+ .object({
424
+ channels: z.number().int().nonnegative(),
425
+ entries: z.number().int().nonnegative().describe('Messages and replies.'),
426
+ attachments: z.number().int().nonnegative(),
427
+ historicalMembers: z
428
+ .number()
429
+ .int()
430
+ .nonnegative()
431
+ .describe('People whose messages move. They join again by invitation.'),
432
+ historicalAgents: z
433
+ .number()
434
+ .int()
435
+ .nonnegative()
436
+ .describe('Agents whose messages move. Their owners pair them again.'),
437
+ attachmentBytes: z.number().int().nonnegative(),
438
+ countedBytes: z
439
+ .number()
440
+ .int()
441
+ .nonnegative()
442
+ .describe('The bytes that will count against the community`s storage limit.'),
443
+ })
444
+ .describe('What an owner export holds, in counts and sizes only.');
445
+ /**
446
+ * One move of a community into hosting, from an owner export.
447
+ *
448
+ * A move fills a brand-new community. The old community is never touched and
449
+ * keeps running until its owner deletes it. Nothing of the new community is
450
+ * visible until the whole export is in. A failed or cancelled move removes the
451
+ * new community and everything uploaded for it, and frees its short name at
452
+ * once, so starting again with the same name works.
453
+ *
454
+ * A `failed` move always says why (`failureCode`); the rule runs one way only.
455
+ * `state` and `failureCode` are tolerant: a value added in a later release
456
+ * reads as `unrecognised` rather than failing the page it arrives in.
457
+ */
458
+ export const CommunityMoveSchema = z
459
+ .object({
460
+ moveId: IdSchema,
461
+ communityId: IdSchema.describe('The new community the export fills. It no longer exists once a move has failed or been cancelled.'),
462
+ communityUrl: ServerUrlSchema.describe('The new community`s canonical link. A runtime value.'),
463
+ name: z.string().min(1).max(80).describe('The name the new community was given.'),
464
+ state: tolerantEnum(CommunityMoveStateSchema).describe('Where the move is. A state this release does not know reads as unrecognised.'),
465
+ failureCode: tolerantEnum(CommunityMoveFailureCodeSchema)
466
+ .nullable()
467
+ .describe('Why the move failed. Always set when the state is failed. A code this release does not know reads as unrecognised.'),
468
+ report: CommunityMoveReportSchema.nullable().describe('What the export holds, once it has been read. Null before then.'),
469
+ pollAfterMs: z
470
+ .number()
471
+ .int()
472
+ .nonnegative()
473
+ .nullable()
474
+ .describe('How long to wait before reading the move again. Null once it has finished.'),
475
+ updatedAt: TimestampSchema,
476
+ })
477
+ .superRefine((move, ctx) => {
478
+ if (move.state === 'failed' && move.failureCode === null) {
479
+ ctx.addIssue({ code: 'custom', path: ['failureCode'], message: 'a failed move says why' });
480
+ }
481
+ })
482
+ .describe('One move of a community into hosting, from an owner export.');
483
+ /**
484
+ * `GET /v1/communities/moves` — the caller's moves.
485
+ *
486
+ * Every unfinished move, and every move that finished (failed, cancelled or
487
+ * claimed) within the last seven days, newest first. It is how the app shows
488
+ * a failed move to a person who closed the app while it was importing: the
489
+ * new community is gone by then, so the hosted-community list cannot.
490
+ */
491
+ export const CommunityMoveListResponseSchema = pageOf(CommunityMoveSchema, 'A page of the caller`s moves: every unfinished one, and those that finished within the last 7 days, newest first.');
492
+ /**
493
+ * `POST /v1/communities/moves` — start a move.
494
+ *
495
+ * The caller names the export by size and digest before sending a byte, so a
496
+ * file too large for a move is refused with `import_too_large`, and one that
497
+ * would not fit the account with `entitlement_required`, before an upload
498
+ * starts. Idempotent on the caller's key, like a start.
499
+ */
500
+ export const CommunityMoveStartRequestSchema = z
501
+ .object({
502
+ idempotencyKey: IdempotencyKeySchema,
503
+ name: CommunityNameSchema,
504
+ shortName: CommunityShortNameSchema.optional().describe('The short name to give the new community. Omitted means none.'),
505
+ orgId: IdSchema.optional().describe('The organization whose account the community belongs to. Omitted means the caller`s personal one.'),
506
+ archiveBytes: z.number().int().positive().describe('The size of the export file, in bytes.'),
507
+ archiveSha256: z
508
+ .string()
509
+ .regex(/^[a-f0-9]{64}$/, 'must be a lower-case hex SHA-256 digest')
510
+ .describe('The SHA-256 of the export file, as lower-case hex.'),
511
+ })
512
+ .describe('Start moving a community in from an owner export. Idempotent on the caller`s key.');
513
+ /**
514
+ * The header that carries an export's digest on its upload, as lower-case hex.
515
+ *
516
+ * The Community server compares it with the bytes it received and refuses the
517
+ * upload when they differ.
518
+ */
519
+ export const COMMUNITY_ARCHIVE_DIGEST_HEADER = 'X-Archive-SHA256';
520
+ /**
521
+ * Where to send the export file.
522
+ *
523
+ * Send the file's exact bytes with `PUT` to `url`, with `token` as a bearer
524
+ * credential, `Content-Length` set to the declared size, and the declared
525
+ * digest in the {@link COMMUNITY_ARCHIVE_DIGEST_HEADER} header. The URL is the
526
+ * Community server's own upload route, so the file goes straight to the host
527
+ * and never through the hosting service.
528
+ *
529
+ * What the Community server answers, in its own error envelope (a JSON body
530
+ * with a `code`, not this contract's `Problem`):
531
+ *
532
+ * - success: the token is spent and the move goes on to `importing`;
533
+ * - `400 IMPORT_ARCHIVE_INVALID`: the bytes did not match the declared size or
534
+ * digest. Nothing is kept, the move stays `awaiting_upload`, and the same
535
+ * token may be used again until `expiresAt`;
536
+ * - a dropped connection part-way: the same, the token still works;
537
+ * - `401`: the upload window has closed. The move is then `failed` with
538
+ * `upload_expired`, and the app starts a new move. A failed move frees its
539
+ * short name at once, so the new move can use the same one.
540
+ */
541
+ export const CommunityMoveUploadSchema = z
542
+ .object({
543
+ url: ServerUrlSchema.describe('Where to send the export. A runtime value.'),
544
+ token: SecretValueSchema.meta({
545
+ description: 'The upload bearer credential. Returned once; never log it.',
546
+ [ONE_TIME_CREDENTIAL_META]: true,
547
+ }),
548
+ expiresAt: TimestampSchema.describe('When the upload window closes.'),
549
+ maxBytes: z.number().int().positive().describe('The largest file the upload accepts.'),
550
+ })
551
+ .describe('Where and how to send the export file. The token is returned once.');
552
+ /**
553
+ * The started move.
554
+ *
555
+ * The first answer carries the upload target, and no later answer does: the
556
+ * token is a credential the service keeps no copy of. `upload` is therefore
557
+ * null exactly when `replayed` is true. A caller that lost it cancels the move
558
+ * and starts a new one; cancelling frees the short name at once.
559
+ */
560
+ export const CommunityMoveStartResponseSchema = z
561
+ .object({
562
+ move: CommunityMoveSchema,
563
+ upload: CommunityMoveUploadSchema.nullable().describe('Where to send the export, or null when this answer repeats an earlier request.'),
564
+ replayed: z
565
+ .boolean()
566
+ .describe('True when this answer repeats an earlier request with the same key.'),
567
+ })
568
+ .superRefine((started, ctx) => {
569
+ if (started.replayed !== (started.upload === null)) {
570
+ ctx.addIssue({
571
+ code: 'custom',
572
+ path: ['upload'],
573
+ message: 'upload is null exactly when the answer is replayed',
574
+ });
575
+ }
576
+ })
577
+ .describe('The started move and, the first time only, where to send the export.');
578
+ //# sourceMappingURL=communities.js.map
@@ -0,0 +1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B,CAAC,IAAI,CAAC;QAC5B,WAAW,EAAE,4DAA4D;QACzE,CAAC,wBAAwB,CAAC,EAAE,IAAI;KACjC,CAAC;IACF,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACrE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CACvF,CAAC;KACD,QAAQ,CAAC,oEAAoE,CAAC,CAAC;AAKlF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,yBAAyB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnD,gFAAgF,CACjF;IACD,QAAQ,EAAE,CAAC;SACR,OAAO,EAAE;SACT,QAAQ,CAAC,qEAAqE,CAAC;CACnF,CAAC;KACD,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;IAC5B,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,QAAQ,CAAC;YAChB,OAAO,EAAE,oDAAoD;SAC9D,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;KACD,QAAQ,CAAC,sEAAsE,CAAC,CAAC"}
@@ -148,11 +148,11 @@ export declare const AuthenticationFlowSchema: z.ZodObject<{
148
148
  flowId: z.ZodString;
149
149
  toolkit: z.ZodString;
150
150
  status: z.ZodEnum<{
151
+ failed: "failed";
151
152
  pending: "pending";
152
153
  expired: "expired";
153
154
  awaiting_user: "awaiting_user";
154
155
  succeeded: "succeeded";
155
- failed: "failed";
156
156
  }>;
157
157
  redirectUrl: z.ZodNullable<z.ZodString>;
158
158
  connectionId: z.ZodNullable<z.ZodString>;
@@ -181,8 +181,8 @@ export declare const AuthorityCommandSchema: z.ZodObject<{
181
181
  commandId: z.ZodString;
182
182
  connectionId: z.ZodString;
183
183
  status: z.ZodEnum<{
184
- succeeded: "succeeded";
185
184
  failed: "failed";
185
+ succeeded: "succeeded";
186
186
  queued: "queued";
187
187
  running: "running";
188
188
  }>;
@@ -202,8 +202,8 @@ export declare const ExecutionSchema: z.ZodObject<{
202
202
  connectionId: z.ZodString;
203
203
  operation: z.ZodString;
204
204
  status: z.ZodEnum<{
205
- succeeded: "succeeded";
206
205
  failed: "failed";
206
+ succeeded: "succeeded";
207
207
  queued: "queued";
208
208
  running: "running";
209
209
  canceled: "canceled";
package/dist/index.d.ts CHANGED
@@ -28,4 +28,5 @@ export * from './billing.js';
28
28
  export * from './inference.js';
29
29
  export * from './seats.js';
30
30
  export * from './remote.js';
31
+ export * from './communities.js';
31
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -28,4 +28,5 @@ export * from './billing.js';
28
28
  export * from './inference.js';
29
29
  export * from './seats.js';
30
30
  export * from './remote.js';
31
+ export * from './communities.js';
31
32
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}