@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.
- package/README.md +51 -1
- package/dist/billing.d.ts +26 -2
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +37 -0
- package/dist/billing.js.map +1 -1
- package/dist/communities.d.ts +706 -0
- package/dist/communities.d.ts.map +1 -0
- package/dist/communities.js +578 -0
- package/dist/communities.js.map +1 -0
- package/dist/connections.d.ts +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/primitives.d.ts +49 -0
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +63 -0
- package/dist/primitives.js.map +1 -1
- package/dist/problem.d.ts +15 -0
- package/dist/problem.d.ts.map +1 -1
- package/dist/problem.js +22 -1
- package/dist/problem.js.map +1 -1
- package/dist/remote.d.ts +2 -2
- package/dist/routes.d.ts +43 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +65 -0
- package/dist/routes.js.map +1 -1
- package/dist/seats.d.ts +5 -5
- package/fixtures/v1/billing/entitlements-communities.json +40 -0
- package/fixtures/v1/communities/claim-link.json +5 -0
- package/fixtures/v1/communities/keep-request.json +3 -0
- package/fixtures/v1/communities/keep.json +34 -0
- package/fixtures/v1/communities/list.json +161 -0
- package/fixtures/v1/communities/move-cancelled.json +11 -0
- package/fixtures/v1/communities/move-claimed.json +19 -0
- package/fixtures/v1/communities/move-failed.json +11 -0
- package/fixtures/v1/communities/move-importing.json +19 -0
- package/fixtures/v1/communities/move-ready.json +19 -0
- package/fixtures/v1/communities/move-start-request.json +7 -0
- package/fixtures/v1/communities/move-start.json +20 -0
- package/fixtures/v1/communities/moves.json +35 -0
- package/fixtures/v1/communities/name-check-free.json +5 -0
- package/fixtures/v1/communities/name-check-taken.json +5 -0
- package/fixtures/v1/communities/restore.json +31 -0
- package/fixtures/v1/communities/start-replay.json +31 -0
- package/fixtures/v1/communities/start-request.json +5 -0
- package/fixtures/v1/communities/start.json +35 -0
- package/fixtures/v1/index.json +24 -1
- package/fixtures/v1/problem/community-name-reserved.json +5 -0
- package/fixtures/v1/problem/community-name-taken.json +5 -0
- package/fixtures/v1/problem/entitlement-required-action.json +8 -0
- package/fixtures/v1/problem/import-too-large.json +6 -0
- package/package.json +3 -3
package/dist/primitives.d.ts
CHANGED
|
@@ -85,4 +85,53 @@ export declare function pageOf<T extends z.ZodTypeAny>(item: T, description: str
|
|
|
85
85
|
items: z.ZodArray<T>;
|
|
86
86
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
87
87
|
}, z.core.$strip>;
|
|
88
|
+
/**
|
|
89
|
+
* A link a person may be sent to: `https:` and nothing else.
|
|
90
|
+
*
|
|
91
|
+
* A plain `url()` accepts any scheme, including `javascript:`, `file:` and
|
|
92
|
+
* `data:`, and a link this contract hands to a browser must never be one of
|
|
93
|
+
* those. The scheme is checked twice on purpose: once by the URL parser, and
|
|
94
|
+
* once as a `pattern` that reaches the generated JSON Schema, so a consumer
|
|
95
|
+
* validating from the JSON Schema alone refuses the same values.
|
|
96
|
+
*/
|
|
97
|
+
export declare const HttpsUrlSchema: z.ZodURL;
|
|
98
|
+
/**
|
|
99
|
+
* A link to a server the DorkOS app talks to: `https:`, or plain `http:` to
|
|
100
|
+
* this machine's loopback address only.
|
|
101
|
+
*
|
|
102
|
+
* Loopback `http:` is allowed so a service and a server running side by side on
|
|
103
|
+
* one machine (development, a self-hosted test) can describe each other. Any
|
|
104
|
+
* other `http:` host, and every other scheme, is refused.
|
|
105
|
+
*/
|
|
106
|
+
export declare const ServerUrlSchema: z.ZodURL;
|
|
107
|
+
/**
|
|
108
|
+
* The metadata key that marks a field as a one-time credential.
|
|
109
|
+
*
|
|
110
|
+
* Set on a schema with `.meta()`, so it reaches the generated JSON Schema as
|
|
111
|
+
* well as the runtime registry (`z.globalRegistry.get(schema)`). A consumer
|
|
112
|
+
* that relays a response (the DorkOS server relaying to its browser, for
|
|
113
|
+
* instance) can refuse to pass any marked field on, and this package's tests
|
|
114
|
+
* prove marked fields appear only where the contract says they may.
|
|
115
|
+
*/
|
|
116
|
+
export declare const ONE_TIME_CREDENTIAL_META: "x-dorkos-one-time-credential";
|
|
117
|
+
/**
|
|
118
|
+
* What a tolerant enum field reads as when the service sends a value this
|
|
119
|
+
* release does not know.
|
|
120
|
+
*/
|
|
121
|
+
export declare const UNRECOGNISED: "unrecognised";
|
|
122
|
+
/**
|
|
123
|
+
* Wraps a published enum so a value added in a later release reads as
|
|
124
|
+
* {@link UNRECOGNISED} instead of failing the whole response.
|
|
125
|
+
*
|
|
126
|
+
* The additive rule lets the service add enum members in a minor release. For
|
|
127
|
+
* a field inside a list or a poll, a strict enum would turn one new state on
|
|
128
|
+
* one item into a failed parse of the whole page. This keeps every other item
|
|
129
|
+
* and gives the app one value to render generically ("in a state this version
|
|
130
|
+
* does not know"). A value that is not a string at all still fails: tolerance
|
|
131
|
+
* is for new members, not for a broken response. The known set stays published
|
|
132
|
+
* as the wrapped enum itself, so a consumer can still narrow on it.
|
|
133
|
+
*
|
|
134
|
+
* @param known - The published enum of known members.
|
|
135
|
+
*/
|
|
136
|
+
export declare function tolerantEnum<T extends z.ZodEnum>(known: T): z.ZodUnion<readonly [T, z.ZodPipe<z.ZodString, z.ZodTransform<"unrecognised", string>>]>;
|
|
88
137
|
//# sourceMappingURL=primitives.d.ts.map
|
package/dist/primitives.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../src/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAG,CAAU,CAAC;AAEvC,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAG,KAAc,CAAC;AAE/C;;;GAGG;AACH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O,MAAM,iBAAiB,aAQ3B,CAAC;AAEJ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,aAQnC,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,aAK3B,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,YAAY,aAG6D,CAAC;AAEvF,kEAAkE;AAClE,eAAO,MAAM,gBAAgB;;;iBAa4D,CAAC;AAE1F,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM;;;kBAS1E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,UAGyC,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,UAMwD,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,EAAG,8BAAuC,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAG,cAAuB,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,4FAQzD"}
|
package/dist/primitives.js
CHANGED
|
@@ -112,4 +112,67 @@ export function pageOf(item, description) {
|
|
|
112
112
|
})
|
|
113
113
|
.describe(description);
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* A link a person may be sent to: `https:` and nothing else.
|
|
117
|
+
*
|
|
118
|
+
* A plain `url()` accepts any scheme, including `javascript:`, `file:` and
|
|
119
|
+
* `data:`, and a link this contract hands to a browser must never be one of
|
|
120
|
+
* those. The scheme is checked twice on purpose: once by the URL parser, and
|
|
121
|
+
* once as a `pattern` that reaches the generated JSON Schema, so a consumer
|
|
122
|
+
* validating from the JSON Schema alone refuses the same values.
|
|
123
|
+
*/
|
|
124
|
+
export const HttpsUrlSchema = z
|
|
125
|
+
.url({ protocol: /^https$/ })
|
|
126
|
+
.regex(/^https:\/\//, 'must be an https: link')
|
|
127
|
+
.describe('An absolute https: link. Any other scheme is refused.');
|
|
128
|
+
/**
|
|
129
|
+
* A link to a server the DorkOS app talks to: `https:`, or plain `http:` to
|
|
130
|
+
* this machine's loopback address only.
|
|
131
|
+
*
|
|
132
|
+
* Loopback `http:` is allowed so a service and a server running side by side on
|
|
133
|
+
* one machine (development, a self-hosted test) can describe each other. Any
|
|
134
|
+
* other `http:` host, and every other scheme, is refused.
|
|
135
|
+
*/
|
|
136
|
+
export const ServerUrlSchema = z
|
|
137
|
+
.url({ protocol: /^https?$/ })
|
|
138
|
+
.regex(/^(https:\/\/|http:\/\/(localhost|127\.0\.0\.1|\[::1\])(:[0-9]+)?([/?#]|$))/, 'must be an https: link, or http: to a loopback address')
|
|
139
|
+
.describe('An absolute https: link, or an http: link to a loopback address only.');
|
|
140
|
+
/**
|
|
141
|
+
* The metadata key that marks a field as a one-time credential.
|
|
142
|
+
*
|
|
143
|
+
* Set on a schema with `.meta()`, so it reaches the generated JSON Schema as
|
|
144
|
+
* well as the runtime registry (`z.globalRegistry.get(schema)`). A consumer
|
|
145
|
+
* that relays a response (the DorkOS server relaying to its browser, for
|
|
146
|
+
* instance) can refuse to pass any marked field on, and this package's tests
|
|
147
|
+
* prove marked fields appear only where the contract says they may.
|
|
148
|
+
*/
|
|
149
|
+
export const ONE_TIME_CREDENTIAL_META = 'x-dorkos-one-time-credential';
|
|
150
|
+
/**
|
|
151
|
+
* What a tolerant enum field reads as when the service sends a value this
|
|
152
|
+
* release does not know.
|
|
153
|
+
*/
|
|
154
|
+
export const UNRECOGNISED = 'unrecognised';
|
|
155
|
+
/**
|
|
156
|
+
* Wraps a published enum so a value added in a later release reads as
|
|
157
|
+
* {@link UNRECOGNISED} instead of failing the whole response.
|
|
158
|
+
*
|
|
159
|
+
* The additive rule lets the service add enum members in a minor release. For
|
|
160
|
+
* a field inside a list or a poll, a strict enum would turn one new state on
|
|
161
|
+
* one item into a failed parse of the whole page. This keeps every other item
|
|
162
|
+
* and gives the app one value to render generically ("in a state this version
|
|
163
|
+
* does not know"). A value that is not a string at all still fails: tolerance
|
|
164
|
+
* is for new members, not for a broken response. The known set stays published
|
|
165
|
+
* as the wrapped enum itself, so a consumer can still narrow on it.
|
|
166
|
+
*
|
|
167
|
+
* @param known - The published enum of known members.
|
|
168
|
+
*/
|
|
169
|
+
export function tolerantEnum(known) {
|
|
170
|
+
return z.union([
|
|
171
|
+
known,
|
|
172
|
+
z
|
|
173
|
+
.string()
|
|
174
|
+
.transform(() => UNRECOGNISED)
|
|
175
|
+
.describe('A value this release does not know. It reads as unrecognised.'),
|
|
176
|
+
]);
|
|
177
|
+
}
|
|
115
178
|
//# sourceMappingURL=primitives.js.map
|
package/dist/primitives.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../src/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAU,CAAC;AAEvC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAwB,CAAC;AAE5D,kEAAkE;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,GAAG;KACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KAC1B,QAAQ,CAAC,kDAAkD,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,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,CACzD;KACA,QAAQ,CAAC,uEAAuE,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAAuC,CAAC;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAuB,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAsB,KAAQ;IACxD,OAAO,CAAC,CAAC,KAAK,CAAC;QACb,KAAK;QACL,CAAC;aACE,MAAM,EAAE;aACR,SAAS,CAAC,GAAwB,EAAE,CAAC,YAAY,CAAC;aAClD,QAAQ,CAAC,+DAA+D,CAAC;KAC7E,CAAC,CAAC;AACL,CAAC"}
|
package/dist/problem.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ export declare const ProblemCodeSchema: z.ZodEnum<{
|
|
|
34
34
|
enrolment_required: "enrolment_required";
|
|
35
35
|
remote_disabled: "remote_disabled";
|
|
36
36
|
address_unavailable: "address_unavailable";
|
|
37
|
+
community_name_taken: "community_name_taken";
|
|
38
|
+
community_name_reserved: "community_name_reserved";
|
|
39
|
+
import_too_large: "import_too_large";
|
|
37
40
|
internal_error: "internal_error";
|
|
38
41
|
temporarily_unavailable: "temporarily_unavailable";
|
|
39
42
|
}>;
|
|
@@ -49,6 +52,13 @@ export type ProblemCode = z.infer<typeof ProblemCodeSchema>;
|
|
|
49
52
|
* is an opaque identifier paired with a server-supplied display string: the
|
|
50
53
|
* client renders what it is given and never switches on the value, and no
|
|
51
54
|
* amount ever appears here.
|
|
55
|
+
*
|
|
56
|
+
* `actionUrl` is the other half of a refusal a person can do something about:
|
|
57
|
+
* the page, supplied by the service, where they can do it (raise an allowance,
|
|
58
|
+
* add credit, contact the host). The client opens it as given, beside `title`
|
|
59
|
+
* and `detail`, and never builds one itself. It is `https:` only, and both it and
|
|
60
|
+
* `actionLabel` are dropped rather than failing the parse when malformed: a bad
|
|
61
|
+
* link must never cost a person the refusal's own words.
|
|
52
62
|
*/
|
|
53
63
|
export declare const ProblemSchema: z.ZodObject<{
|
|
54
64
|
code: z.ZodEnum<{
|
|
@@ -79,6 +89,9 @@ export declare const ProblemSchema: z.ZodObject<{
|
|
|
79
89
|
enrolment_required: "enrolment_required";
|
|
80
90
|
remote_disabled: "remote_disabled";
|
|
81
91
|
address_unavailable: "address_unavailable";
|
|
92
|
+
community_name_taken: "community_name_taken";
|
|
93
|
+
community_name_reserved: "community_name_reserved";
|
|
94
|
+
import_too_large: "import_too_large";
|
|
82
95
|
internal_error: "internal_error";
|
|
83
96
|
temporarily_unavailable: "temporarily_unavailable";
|
|
84
97
|
}>;
|
|
@@ -90,6 +103,8 @@ export declare const ProblemSchema: z.ZodObject<{
|
|
|
90
103
|
requiredPlanId: z.ZodOptional<z.ZodString>;
|
|
91
104
|
requiredPlanDisplayName: z.ZodOptional<z.ZodString>;
|
|
92
105
|
freesAt: z.ZodOptional<z.ZodISODateTime>;
|
|
106
|
+
actionUrl: z.ZodCatch<z.ZodOptional<z.ZodURL>>;
|
|
107
|
+
actionLabel: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
93
108
|
}, z.core.$strip>;
|
|
94
109
|
/** The error envelope every endpoint returns in place of its success body. */
|
|
95
110
|
export type Problem = z.infer<typeof ProblemSchema>;
|
package/dist/problem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"problem.d.ts","sourceRoot":"","sources":["../src/problem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"problem.d.ts","sourceRoot":"","sources":["../src/problem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4C3B,CAAC;AAEJ,sEAAsE;AACtE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkDvB,CAAC;AAEJ,8EAA8E;AAC9E,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D"}
|
package/dist/problem.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { IdSchema, TimestampSchema } from './primitives.js';
|
|
2
|
+
import { HttpsUrlSchema, IdSchema, TimestampSchema } from './primitives.js';
|
|
3
3
|
/**
|
|
4
4
|
* Every machine-readable failure code this contract can return.
|
|
5
5
|
*
|
|
@@ -41,6 +41,10 @@ export const ProblemCodeSchema = z
|
|
|
41
41
|
'enrolment_required',
|
|
42
42
|
'remote_disabled',
|
|
43
43
|
'address_unavailable',
|
|
44
|
+
// Hosted communities.
|
|
45
|
+
'community_name_taken',
|
|
46
|
+
'community_name_reserved',
|
|
47
|
+
'import_too_large',
|
|
44
48
|
// The server's own faults.
|
|
45
49
|
'internal_error',
|
|
46
50
|
'temporarily_unavailable',
|
|
@@ -56,6 +60,13 @@ export const ProblemCodeSchema = z
|
|
|
56
60
|
* is an opaque identifier paired with a server-supplied display string: the
|
|
57
61
|
* client renders what it is given and never switches on the value, and no
|
|
58
62
|
* amount ever appears here.
|
|
63
|
+
*
|
|
64
|
+
* `actionUrl` is the other half of a refusal a person can do something about:
|
|
65
|
+
* the page, supplied by the service, where they can do it (raise an allowance,
|
|
66
|
+
* add credit, contact the host). The client opens it as given, beside `title`
|
|
67
|
+
* and `detail`, and never builds one itself. It is `https:` only, and both it and
|
|
68
|
+
* `actionLabel` are dropped rather than failing the parse when malformed: a bad
|
|
69
|
+
* link must never cost a person the refusal's own words.
|
|
59
70
|
*/
|
|
60
71
|
export const ProblemSchema = z
|
|
61
72
|
.object({
|
|
@@ -84,6 +95,16 @@ export const ProblemSchema = z
|
|
|
84
95
|
.optional()
|
|
85
96
|
.describe('The server-supplied display string for `requiredPlanId`.'),
|
|
86
97
|
freesAt: TimestampSchema.optional().describe('When the blocking condition clears, where the server can say so.'),
|
|
98
|
+
actionUrl: HttpsUrlSchema.optional()
|
|
99
|
+
.catch(undefined)
|
|
100
|
+
.describe('A page, supplied by the service, where a person can act on this refusal. An https: link; open it as given. A malformed value is dropped rather than failing the whole envelope.'),
|
|
101
|
+
actionLabel: z
|
|
102
|
+
.string()
|
|
103
|
+
.min(1)
|
|
104
|
+
.max(60)
|
|
105
|
+
.optional()
|
|
106
|
+
.catch(undefined)
|
|
107
|
+
.describe('The server-supplied text for a link or button that opens `actionUrl`. A malformed value is dropped.'),
|
|
87
108
|
})
|
|
88
109
|
.describe('The error envelope every endpoint in this contract returns in place of its success body.');
|
|
89
110
|
/**
|
package/dist/problem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"problem.js","sourceRoot":"","sources":["../src/problem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"problem.js","sourceRoot":"","sources":["../src/problem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,IAAI,CAAC;IACJ,oCAAoC;IACpC,iBAAiB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C,QAAQ,EAAE,CAAC,QAAQ,CAC1C,6IAA6I,CAC9I;IACD,uBAAuB,EAAE,CAAC;SACvB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC1C,kEAAkE,CACnE;IACD,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE;SACjC,KAAK,CAAC,SAAS,CAAC;SAChB,QAAQ,CACP,iLAAiL,CAClL;IACH,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,KAAK,CAAC,SAAS,CAAC;SAChB,QAAQ,CACP,qGAAqG,CACtG;CACJ,CAAC;KACD,QAAQ,CACP,0FAA0F,CAC3F,CAAC;AAKJ;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAChD,CAAC"}
|
package/dist/remote.d.ts
CHANGED
|
@@ -126,8 +126,8 @@ export declare const CustomAddressStatusSchema: z.ZodEnum<{
|
|
|
126
126
|
/** Where a custom hostname`s certificate is. */
|
|
127
127
|
export declare const CertificateStateSchema: z.ZodEnum<{
|
|
128
128
|
none: "none";
|
|
129
|
-
pending: "pending";
|
|
130
129
|
failed: "failed";
|
|
130
|
+
pending: "pending";
|
|
131
131
|
issued: "issued";
|
|
132
132
|
renewing: "renewing";
|
|
133
133
|
}>;
|
|
@@ -147,8 +147,8 @@ export declare const RemoteCustomAddressSchema: z.ZodObject<{
|
|
|
147
147
|
certificate: z.ZodObject<{
|
|
148
148
|
state: z.ZodEnum<{
|
|
149
149
|
none: "none";
|
|
150
|
-
pending: "pending";
|
|
151
150
|
failed: "failed";
|
|
151
|
+
pending: "pending";
|
|
152
152
|
issued: "issued";
|
|
153
153
|
renewing: "renewing";
|
|
154
154
|
}>;
|
package/dist/routes.d.ts
CHANGED
|
@@ -50,6 +50,9 @@ export declare const V1_ROUTES: {
|
|
|
50
50
|
readonly remoteCommands: "/v1/remote/commands";
|
|
51
51
|
readonly remoteCommandsAck: "/v1/remote/commands/ack";
|
|
52
52
|
readonly remoteEvents: "/v1/remote/events";
|
|
53
|
+
readonly communities: "/v1/communities";
|
|
54
|
+
readonly communitiesNameCheck: "/v1/communities/name-check";
|
|
55
|
+
readonly communitiesMoves: "/v1/communities/moves";
|
|
53
56
|
};
|
|
54
57
|
/** One of the fixed `/v1` paths. */
|
|
55
58
|
export type V1Route = (typeof V1_ROUTES)[keyof typeof V1_ROUTES];
|
|
@@ -270,5 +273,45 @@ export declare const v1Path: {
|
|
|
270
273
|
* @param addressId - The address's opaque identifier.
|
|
271
274
|
*/
|
|
272
275
|
readonly address: (addressId: string) => string;
|
|
276
|
+
/**
|
|
277
|
+
* The route that issues a fresh owner-claim link for one hosted community,
|
|
278
|
+
* answered with `CommunityClaimLinkSchema`. Only while the community is
|
|
279
|
+
* `pending_owner`, and refused with `conflict` otherwise; the previous link
|
|
280
|
+
* stops working.
|
|
281
|
+
*
|
|
282
|
+
* @param communityId - The community's permanent identifier.
|
|
283
|
+
*/
|
|
284
|
+
readonly communityClaimLink: (communityId: string) => string;
|
|
285
|
+
/**
|
|
286
|
+
* The route that keeps one hosted community open. Takes
|
|
287
|
+
* `CommunityKeepRequestSchema` and answers with `CommunityKeepResponseSchema`;
|
|
288
|
+
* a stale `expectedHeldCommunityIds` is refused with `conflict`.
|
|
289
|
+
*
|
|
290
|
+
* @param communityId - The community's permanent identifier.
|
|
291
|
+
*/
|
|
292
|
+
readonly communityKeep: (communityId: string) => string;
|
|
293
|
+
/**
|
|
294
|
+
* The route that reopens one held community, answered with
|
|
295
|
+
* `HostedCommunitySchema`. It never puts another community on hold: a
|
|
296
|
+
* community that does not fit is refused with `entitlement_required`, and a
|
|
297
|
+
* hold the host placed with `forbidden`.
|
|
298
|
+
*
|
|
299
|
+
* @param communityId - The community's permanent identifier.
|
|
300
|
+
*/
|
|
301
|
+
readonly communityRestore: (communityId: string) => string;
|
|
302
|
+
/**
|
|
303
|
+
* The route for one move, answered with `CommunityMoveSchema`.
|
|
304
|
+
*
|
|
305
|
+
* @param moveId - The move's opaque identifier.
|
|
306
|
+
*/
|
|
307
|
+
readonly communityMove: (moveId: string) => string;
|
|
308
|
+
/**
|
|
309
|
+
* The route that cancels one move, answered with `CommunityMoveSchema`.
|
|
310
|
+
* Allowed until the move is `ready`, and refused with `conflict` after that.
|
|
311
|
+
* Cancelling removes the new community and everything uploaded for it.
|
|
312
|
+
*
|
|
313
|
+
* @param moveId - The move's opaque identifier.
|
|
314
|
+
*/
|
|
315
|
+
readonly communityMoveCancel: (moveId: string) => string;
|
|
273
316
|
};
|
|
274
317
|
//# sourceMappingURL=routes.d.ts.map
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mDAAmD;AACnD,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mDAAmD;AACnD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CZ,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEjE;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM;IACjB;;;;OAIG;wCACwB,MAAM;IACjC;;;;OAIG;6CAC6B,MAAM;IACtC;;;;OAIG;uCACuB,MAAM;IAChC;;;;OAIG;0CAC0B,MAAM;IACnC;;;;OAIG;sCACsB,MAAM;IAC/B;;;;OAIG;0CAC0B,MAAM;IACnC;;;;OAIG;2CAC2B,MAAM;IACpC;;;;OAIG;oCACoB,MAAM;IAC7B;;;;OAIG;uCACuB,MAAM;IAChC;;;;OAIG;6CAC6B,MAAM;IACtC;;;;OAIG;0BACU,MAAM;IACnB;;;;OAIG;iCACiB,MAAM;IAC1B;;;;;OAKG;gCACgB,MAAM,YAAY,MAAM;IAC3C;;;;OAIG;qCACqB,MAAM;IAC9B;;;;;OAKG;oCACoB,MAAM,gBAAgB,MAAM;IAEnD;;;;OAIG;8CAC8B,MAAM;IACvC;;;;OAIG;+BACe,MAAM;IACxB;;;;OAIG;gCACgB,MAAM;IACzB;;;;OAIG;2CAC2B,MAAM;IACpC;;;;OAIG;8BACc,MAAM;IACvB;;;;;OAKG;0CAC0B,MAAM,WAAW,MAAM;IAEpD;;;;OAIG;4BACY,MAAM;IACrB;;;;OAIG;kCACkB,MAAM;IAC3B;;;;OAIG;mCACmB,MAAM;IAC5B;;;;OAIG;kCACkB,MAAM;IAC3B;;;;OAIG;mCACmB,MAAM;IAC5B;;;;OAIG;kCACkB,MAAM;IAC3B;;;;OAIG;kCACkB,MAAM;IAC3B;;;;;OAKG;iCACiB,MAAM,QAAQ,MAAM;IACxC;;;;OAIG;iCACiB,MAAM;IAC1B;;;;OAIG;qCACqB,MAAM;IAC9B;;;;OAIG;oCACoB,MAAM;IAC7B;;;;OAIG;oCACoB,MAAM;IAC7B;;;;OAIG;kCACkB,MAAM;IAC3B;;;;;;;OAOG;+CAC+B,MAAM;IAExC;;;;;;OAMG;0CAC0B,MAAM;IACnC;;;;;;;OAOG;6CAC6B,MAAM;IACtC;;;;OAIG;qCACqB,MAAM;IAC9B;;;;;;OAMG;2CAC2B,MAAM;CAC5B,CAAC"}
|
package/dist/routes.js
CHANGED
|
@@ -50,6 +50,9 @@ export const V1_ROUTES = {
|
|
|
50
50
|
remoteCommands: '/v1/remote/commands',
|
|
51
51
|
remoteCommandsAck: '/v1/remote/commands/ack',
|
|
52
52
|
remoteEvents: '/v1/remote/events',
|
|
53
|
+
communities: '/v1/communities',
|
|
54
|
+
communitiesNameCheck: '/v1/communities/name-check',
|
|
55
|
+
communitiesMoves: '/v1/communities/moves',
|
|
53
56
|
};
|
|
54
57
|
/**
|
|
55
58
|
* The `/v1` paths that take a path parameter, as builders.
|
|
@@ -268,7 +271,69 @@ export const v1Path = {
|
|
|
268
271
|
* @param addressId - The address's opaque identifier.
|
|
269
272
|
*/
|
|
270
273
|
address: (addressId) => `/v1/addresses/${enc(addressId)}`,
|
|
274
|
+
/**
|
|
275
|
+
* The route that issues a fresh owner-claim link for one hosted community,
|
|
276
|
+
* answered with `CommunityClaimLinkSchema`. Only while the community is
|
|
277
|
+
* `pending_owner`, and refused with `conflict` otherwise; the previous link
|
|
278
|
+
* stops working.
|
|
279
|
+
*
|
|
280
|
+
* @param communityId - The community's permanent identifier.
|
|
281
|
+
*/
|
|
282
|
+
communityClaimLink: (communityId) => `/v1/communities/${communityEnc(communityId)}/claim-link`,
|
|
283
|
+
/**
|
|
284
|
+
* The route that keeps one hosted community open. Takes
|
|
285
|
+
* `CommunityKeepRequestSchema` and answers with `CommunityKeepResponseSchema`;
|
|
286
|
+
* a stale `expectedHeldCommunityIds` is refused with `conflict`.
|
|
287
|
+
*
|
|
288
|
+
* @param communityId - The community's permanent identifier.
|
|
289
|
+
*/
|
|
290
|
+
communityKeep: (communityId) => `/v1/communities/${communityEnc(communityId)}/keep`,
|
|
291
|
+
/**
|
|
292
|
+
* The route that reopens one held community, answered with
|
|
293
|
+
* `HostedCommunitySchema`. It never puts another community on hold: a
|
|
294
|
+
* community that does not fit is refused with `entitlement_required`, and a
|
|
295
|
+
* hold the host placed with `forbidden`.
|
|
296
|
+
*
|
|
297
|
+
* @param communityId - The community's permanent identifier.
|
|
298
|
+
*/
|
|
299
|
+
communityRestore: (communityId) => `/v1/communities/${communityEnc(communityId)}/restore`,
|
|
300
|
+
/**
|
|
301
|
+
* The route for one move, answered with `CommunityMoveSchema`.
|
|
302
|
+
*
|
|
303
|
+
* @param moveId - The move's opaque identifier.
|
|
304
|
+
*/
|
|
305
|
+
communityMove: (moveId) => `/v1/communities/moves/${enc(moveId)}`,
|
|
306
|
+
/**
|
|
307
|
+
* The route that cancels one move, answered with `CommunityMoveSchema`.
|
|
308
|
+
* Allowed until the move is `ready`, and refused with `conflict` after that.
|
|
309
|
+
* Cancelling removes the new community and everything uploaded for it.
|
|
310
|
+
*
|
|
311
|
+
* @param moveId - The move's opaque identifier.
|
|
312
|
+
*/
|
|
313
|
+
communityMoveCancel: (moveId) => `/v1/communities/moves/${enc(moveId)}/cancel`,
|
|
271
314
|
};
|
|
315
|
+
/**
|
|
316
|
+
* The fixed segments that sit where a community identifier would.
|
|
317
|
+
*
|
|
318
|
+
* `/v1/communities/moves` and `/v1/communities/name-check` share a prefix with
|
|
319
|
+
* `/v1/communities/{communityId}/…`, so a community identifier equal to one of
|
|
320
|
+
* them would build a path a router could read as the other route. The service
|
|
321
|
+
* issues opaque identifiers that are never these words, so one arriving here is
|
|
322
|
+
* a caller bug, refused like a dot segment.
|
|
323
|
+
*/
|
|
324
|
+
const COMMUNITY_FIXED_SEGMENTS = new Set(['moves', 'name-check']);
|
|
325
|
+
/**
|
|
326
|
+
* Encodes a community identifier, refusing one that names a fixed route.
|
|
327
|
+
*
|
|
328
|
+
* @param communityId - The community's permanent identifier.
|
|
329
|
+
* @throws TypeError - When the identifier is a fixed segment, empty, or a dot segment.
|
|
330
|
+
*/
|
|
331
|
+
function communityEnc(communityId) {
|
|
332
|
+
if (COMMUNITY_FIXED_SEGMENTS.has(communityId)) {
|
|
333
|
+
throw new TypeError(`A community identifier must not be ${JSON.stringify(communityId)}; it names another route.`);
|
|
334
|
+
}
|
|
335
|
+
return enc(communityId);
|
|
336
|
+
}
|
|
272
337
|
/**
|
|
273
338
|
* Encodes one opaque identifier for use as a single path segment.
|
|
274
339
|
*
|
package/dist/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
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/D,CAAC;IACD,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CACjB,0DAA0D,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,2CAA2C,CAC7H,CAAC;IACJ,CAAC;IACD,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/seats.d.ts
CHANGED
|
@@ -202,8 +202,8 @@ export declare const SeatKindSchema: z.ZodEnum<{
|
|
|
202
202
|
/** Where a seat is in its lifecycle. */
|
|
203
203
|
export declare const SeatStatusSchema: z.ZodEnum<{
|
|
204
204
|
assigned: "assigned";
|
|
205
|
-
unassigned: "unassigned";
|
|
206
205
|
suspended: "suspended";
|
|
206
|
+
unassigned: "unassigned";
|
|
207
207
|
released: "released";
|
|
208
208
|
}>;
|
|
209
209
|
/** Whether an address is live or has been retired. */
|
|
@@ -274,8 +274,8 @@ export declare const SeatSchema: z.ZodObject<{
|
|
|
274
274
|
}>;
|
|
275
275
|
status: z.ZodEnum<{
|
|
276
276
|
assigned: "assigned";
|
|
277
|
-
unassigned: "unassigned";
|
|
278
277
|
suspended: "suspended";
|
|
278
|
+
unassigned: "unassigned";
|
|
279
279
|
released: "released";
|
|
280
280
|
}>;
|
|
281
281
|
subject: z.ZodNullable<z.ZodObject<{
|
|
@@ -315,8 +315,8 @@ export declare const SeatListResponseSchema: z.ZodObject<{
|
|
|
315
315
|
}>;
|
|
316
316
|
status: z.ZodEnum<{
|
|
317
317
|
assigned: "assigned";
|
|
318
|
-
unassigned: "unassigned";
|
|
319
318
|
suspended: "suspended";
|
|
319
|
+
unassigned: "unassigned";
|
|
320
320
|
released: "released";
|
|
321
321
|
}>;
|
|
322
322
|
subject: z.ZodNullable<z.ZodObject<{
|
|
@@ -574,8 +574,8 @@ export declare const InboxBrowseResponseSchema: z.ZodObject<{
|
|
|
574
574
|
}, z.core.$strip>;
|
|
575
575
|
/** How reachable a seat is right now. */
|
|
576
576
|
export declare const PresenceStateSchema: z.ZodEnum<{
|
|
577
|
-
active: "active";
|
|
578
577
|
unknown: "unknown";
|
|
578
|
+
active: "active";
|
|
579
579
|
offline: "offline";
|
|
580
580
|
reachable: "reachable";
|
|
581
581
|
}>;
|
|
@@ -583,8 +583,8 @@ export declare const PresenceStateSchema: z.ZodEnum<{
|
|
|
583
583
|
export declare const PresenceSchema: z.ZodObject<{
|
|
584
584
|
seatId: z.ZodString;
|
|
585
585
|
state: z.ZodEnum<{
|
|
586
|
-
active: "active";
|
|
587
586
|
unknown: "unknown";
|
|
587
|
+
active: "active";
|
|
588
588
|
offline: "offline";
|
|
589
589
|
reachable: "reachable";
|
|
590
590
|
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"planId": "pl_opaque_0000",
|
|
3
|
+
"planDisplayName": "the entitlement shown in your billing page",
|
|
4
|
+
"periodStart": "2026-09-15T12:00:00.000Z",
|
|
5
|
+
"periodEnd": "2026-10-15T12:00:00.000Z",
|
|
6
|
+
"limits": {
|
|
7
|
+
"personSeatsIncluded": 1,
|
|
8
|
+
"agentSeatsIncluded": 0,
|
|
9
|
+
"includedCreditsMicro": "0",
|
|
10
|
+
"cloudHours": 0,
|
|
11
|
+
"storageGb": 1,
|
|
12
|
+
"remoteAccess": "byo",
|
|
13
|
+
"alwaysAvailableInstances": 0,
|
|
14
|
+
"customAddress": "none",
|
|
15
|
+
"managedConnectionActions": null,
|
|
16
|
+
"support": "community",
|
|
17
|
+
"emailAddressPerSeat": false,
|
|
18
|
+
"communities": {
|
|
19
|
+
"maxCommunities": 3,
|
|
20
|
+
"maxMembersPerCommunity": 200,
|
|
21
|
+
"maxStorageBytesPerCommunity": 2000000000
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"used": {
|
|
25
|
+
"personSeats": 1,
|
|
26
|
+
"agentSeats": 0,
|
|
27
|
+
"communities": 1
|
|
28
|
+
},
|
|
29
|
+
"seats": {
|
|
30
|
+
"total": 1,
|
|
31
|
+
"assigned": 1,
|
|
32
|
+
"byKind": {
|
|
33
|
+
"person": 1,
|
|
34
|
+
"agent": 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"canCreateSeat": false,
|
|
38
|
+
"canInviteMember": false,
|
|
39
|
+
"staleAt": "2026-10-15T12:00:00.000Z"
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"community": {
|
|
3
|
+
"communityId": "2b3c4d5e-6f70-4812-9a3b-4c5d6e7f8091",
|
|
4
|
+
"orgId": "org_0001",
|
|
5
|
+
"name": "Reading group",
|
|
6
|
+
"shortName": "reading-group",
|
|
7
|
+
"communityUrl": "https://community.example.invalid/c/2b3c4d5e-6f70-4812-9a3b-4c5d6e7f8091",
|
|
8
|
+
"state": "active",
|
|
9
|
+
"hold": null,
|
|
10
|
+
"deletionAt": null,
|
|
11
|
+
"notice": null,
|
|
12
|
+
"kept": true,
|
|
13
|
+
"moveId": null,
|
|
14
|
+
"limits": {
|
|
15
|
+
"maxActiveMembers": 200,
|
|
16
|
+
"maxStorageBytes": 2000000000
|
|
17
|
+
},
|
|
18
|
+
"usage": {
|
|
19
|
+
"activeMembers": 12,
|
|
20
|
+
"storageBytes": 48213504,
|
|
21
|
+
"measuredAt": "2026-09-23T12:00:00.000Z"
|
|
22
|
+
},
|
|
23
|
+
"actions": {
|
|
24
|
+
"claimLink": false,
|
|
25
|
+
"keep": {
|
|
26
|
+
"allowed": false,
|
|
27
|
+
"wouldHold": []
|
|
28
|
+
},
|
|
29
|
+
"restore": false
|
|
30
|
+
},
|
|
31
|
+
"createdAt": "2025-06-01T09:00:00.000Z"
|
|
32
|
+
},
|
|
33
|
+
"heldCommunityIds": ["4f1c2b7e-8a3d-4e5f-9b6a-1c2d3e4f5a6b"]
|
|
34
|
+
}
|