@possibl/rcrt-sdk 0.1.3 → 0.5.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/CHANGELOG.md +87 -0
- package/README.md +35 -4
- package/dist/authn.d.ts +30 -0
- package/dist/authn.d.ts.map +1 -1
- package/dist/authn.js +32 -0
- package/dist/authn.js.map +1 -1
- package/dist/breadcrumbs.d.ts +11 -0
- package/dist/breadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs.js +26 -0
- package/dist/breadcrumbs.js.map +1 -1
- package/dist/cards.d.ts.map +1 -1
- package/dist/cards.js +0 -1
- package/dist/cards.js.map +1 -1
- package/dist/chat.d.ts +53 -0
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +47 -0
- package/dist/chat.js.map +1 -1
- package/dist/client.d.ts +40 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +64 -0
- package/dist/client.js.map +1 -1
- package/dist/files.d.ts +41 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +64 -0
- package/dist/files.js.map +1 -0
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/fetch.d.ts +6 -0
- package/dist/internal/fetch.d.ts.map +1 -1
- package/dist/internal/fetch.js +2 -0
- package/dist/internal/fetch.js.map +1 -1
- package/dist/marketplace.d.ts +98 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/marketplace.js +74 -0
- package/dist/marketplace.js.map +1 -0
- package/dist/members.d.ts +60 -0
- package/dist/members.d.ts.map +1 -0
- package/dist/members.js +74 -0
- package/dist/members.js.map +1 -0
- package/dist/org.d.ts +85 -0
- package/dist/org.d.ts.map +1 -0
- package/dist/org.js +70 -0
- package/dist/org.js.map +1 -0
- package/dist/types/engine.d.ts +69 -0
- package/dist/types/engine.d.ts.map +1 -0
- package/dist/types/engine.js +53 -0
- package/dist/types/engine.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -14,20 +14,38 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Every module on the client shares the same fetch context — one
|
|
16
16
|
* bearer refresh path, one tenant header, one error envelope.
|
|
17
|
+
*
|
|
18
|
+
* For fleet fan-out across workspaces, prefer `forTenant()` over
|
|
19
|
+
* mutating one client with `setTenantId()`:
|
|
20
|
+
*
|
|
21
|
+
* await Promise.all(workspaces.map((ws) =>
|
|
22
|
+
* rcrt.forTenant(ws.id).breadcrumbs.queryByTags(['interpret:alert']),
|
|
23
|
+
* ));
|
|
17
24
|
*/
|
|
25
|
+
import { request } from './internal/fetch.js';
|
|
18
26
|
import { BreadcrumbsModule } from './breadcrumbs.js';
|
|
19
27
|
import { ChatModule } from './chat.js';
|
|
20
28
|
import { CardsModule } from './cards.js';
|
|
21
29
|
import { GrantsModule } from './grants.js';
|
|
22
30
|
import { IdentityModule } from './authn.js';
|
|
31
|
+
import { MarketplaceModule } from './marketplace.js';
|
|
32
|
+
import { OrgModule } from './org.js';
|
|
33
|
+
import { FilesModule } from './files.js';
|
|
34
|
+
import { MembersModule } from './members.js';
|
|
23
35
|
import { SdkError } from './errors.js';
|
|
24
36
|
export class RcrtClient {
|
|
25
37
|
ctx;
|
|
38
|
+
config;
|
|
39
|
+
tenantClients = new Map();
|
|
26
40
|
auth;
|
|
27
41
|
breadcrumbs;
|
|
28
42
|
chat;
|
|
29
43
|
cards;
|
|
30
44
|
grants;
|
|
45
|
+
marketplace;
|
|
46
|
+
org;
|
|
47
|
+
files;
|
|
48
|
+
members;
|
|
31
49
|
constructor(config) {
|
|
32
50
|
if (!config.apiUrl) {
|
|
33
51
|
throw new SdkError('MISSING_API_URL', 'RcrtClient requires `apiUrl`');
|
|
@@ -35,6 +53,7 @@ export class RcrtClient {
|
|
|
35
53
|
if (!config.tokenProvider) {
|
|
36
54
|
throw new SdkError('MISSING_TOKEN_PROVIDER', 'RcrtClient requires a `tokenProvider`');
|
|
37
55
|
}
|
|
56
|
+
this.config = config;
|
|
38
57
|
const ctxInternal = {
|
|
39
58
|
apiUrl: config.apiUrl,
|
|
40
59
|
tenantId: config.tenantId ?? null,
|
|
@@ -56,6 +75,10 @@ export class RcrtClient {
|
|
|
56
75
|
this.chat = new ChatModule(this.ctx);
|
|
57
76
|
this.cards = new CardsModule(this.ctx);
|
|
58
77
|
this.grants = new GrantsModule(this.ctx);
|
|
78
|
+
this.marketplace = new MarketplaceModule(this.ctx);
|
|
79
|
+
this.org = new OrgModule(this.ctx);
|
|
80
|
+
this.files = new FilesModule(this.ctx);
|
|
81
|
+
this.members = new MembersModule(this.ctx);
|
|
59
82
|
}
|
|
60
83
|
/** Switch workspaces. Subsequent requests carry the new `X-Tenant-ID`. */
|
|
61
84
|
setTenantId(tenantId) {
|
|
@@ -65,5 +88,46 @@ export class RcrtClient {
|
|
|
65
88
|
getTenantId() {
|
|
66
89
|
return this.ctx.tenantId;
|
|
67
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* A client permanently bound to `tenantId` — same apiUrl, token
|
|
93
|
+
* provider and fetch impl, its own tenant header. Instances are
|
|
94
|
+
* cached per tenant and are just thin header wrappers, so parallel
|
|
95
|
+
* fleet fan-out is safe and cheap (no shared-client races, no
|
|
96
|
+
* serialisation through `setTenantId`).
|
|
97
|
+
*/
|
|
98
|
+
forTenant(tenantId) {
|
|
99
|
+
if (!tenantId) {
|
|
100
|
+
throw new SdkError('MISSING_TENANT_ID', 'forTenant requires a tenant id');
|
|
101
|
+
}
|
|
102
|
+
let c = this.tenantClients.get(tenantId);
|
|
103
|
+
if (!c) {
|
|
104
|
+
const cfg = {
|
|
105
|
+
apiUrl: this.config.apiUrl,
|
|
106
|
+
tokenProvider: this.config.tokenProvider,
|
|
107
|
+
tenantId,
|
|
108
|
+
};
|
|
109
|
+
if (this.config.fetchImpl)
|
|
110
|
+
cfg.fetchImpl = this.config.fetchImpl;
|
|
111
|
+
c = new RcrtClient(cfg);
|
|
112
|
+
this.tenantClients.set(tenantId, c);
|
|
113
|
+
}
|
|
114
|
+
return c;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Typed escape hatch — call any gateway endpoint with the client's
|
|
118
|
+
* auth + tenant + retry handling. Apps are never blocked on an SDK
|
|
119
|
+
* release for a new endpoint:
|
|
120
|
+
*
|
|
121
|
+
* const res = await rcrt.request<{ items: Item[] }>('/v1/some/new/endpoint', {
|
|
122
|
+
* method: 'POST',
|
|
123
|
+
* body: { hello: 'world' }, // plain object — the SDK serialises
|
|
124
|
+
* });
|
|
125
|
+
*
|
|
126
|
+
* `options.body` is JSON-serialised; use `options.rawBody` for
|
|
127
|
+
* FormData / binary payloads; `options.query` appends search params.
|
|
128
|
+
*/
|
|
129
|
+
async request(path, options = {}) {
|
|
130
|
+
return request(this.ctx, path, options);
|
|
131
|
+
}
|
|
68
132
|
}
|
|
69
133
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,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GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,GAAG,GAAqB;gBAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;gBAC1B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;gBACxC,QAAQ;aACT,CAAC;YACF,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS;gBAAE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YACjE,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,OAAO,CAAc,IAAY,EAAE,UAA0B,EAAE;QACnE,OAAO,OAAO,CAAI,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
package/dist/files.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Files module — `/v1/files` upload + retrieval.
|
|
3
|
+
*
|
|
4
|
+
* Uploads use multipart `FormData`, which is global in browsers,
|
|
5
|
+
* Node 18+ and React Native — no extra dependency needed. Every file
|
|
6
|
+
* lands as a breadcrumb, so downstream reads are normal breadcrumb
|
|
7
|
+
* reads too.
|
|
8
|
+
*/
|
|
9
|
+
import type { FetchContext } from './internal/fetch.js';
|
|
10
|
+
import type { Breadcrumb } from './types/breadcrumb.js';
|
|
11
|
+
export type FileScope = 'tenant' | 'org' | 'user';
|
|
12
|
+
export interface UploadFileOptions {
|
|
13
|
+
/** Who can see the file. Default `'tenant'`. */
|
|
14
|
+
scope?: FileScope;
|
|
15
|
+
/** Override the filename recorded server-side (useful for raw Blobs). */
|
|
16
|
+
filename?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class FilesModule {
|
|
19
|
+
private readonly ctx;
|
|
20
|
+
constructor(ctx: FetchContext);
|
|
21
|
+
/**
|
|
22
|
+
* `POST /v1/files` — multipart upload. Returns the file's breadcrumb.
|
|
23
|
+
*
|
|
24
|
+
* Accepts a `File` (browser), `Blob`, or anything FormData takes.
|
|
25
|
+
*/
|
|
26
|
+
upload(file: Blob, opts?: UploadFileOptions): Promise<Breadcrumb>;
|
|
27
|
+
/** `GET /v1/files` — file breadcrumbs visible at the given scope. */
|
|
28
|
+
list(opts?: {
|
|
29
|
+
scope?: FileScope;
|
|
30
|
+
limit?: number;
|
|
31
|
+
}): Promise<Breadcrumb[]>;
|
|
32
|
+
/** `GET /v1/files/{id}` */
|
|
33
|
+
get(fileId: string): Promise<Breadcrumb>;
|
|
34
|
+
/** `GET /v1/files/{id}/content` — short-lived signed download URL. */
|
|
35
|
+
downloadUrl(fileId: string, expiry?: string): Promise<string>;
|
|
36
|
+
/** `GET /v1/files/{id}/text` — extracted text content (PDFs, docs, …). */
|
|
37
|
+
getText(fileId: string): Promise<string>;
|
|
38
|
+
/** `DELETE /v1/files/{id}` */
|
|
39
|
+
delete(fileId: string): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,YAAY;IAE9C;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;IAe3E,qEAAqE;IAC/D,IAAI,CAAC,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOnF,2BAA2B;IACrB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAK9C,sEAAsE;IAChE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,SAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAOjE,0EAA0E;IACpE,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9C,8BAA8B;IACxB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5C"}
|
package/dist/files.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Files module — `/v1/files` upload + retrieval.
|
|
3
|
+
*
|
|
4
|
+
* Uploads use multipart `FormData`, which is global in browsers,
|
|
5
|
+
* Node 18+ and React Native — no extra dependency needed. Every file
|
|
6
|
+
* lands as a breadcrumb, so downstream reads are normal breadcrumb
|
|
7
|
+
* reads too.
|
|
8
|
+
*/
|
|
9
|
+
import { request } from './internal/fetch.js';
|
|
10
|
+
export class FilesModule {
|
|
11
|
+
ctx;
|
|
12
|
+
constructor(ctx) {
|
|
13
|
+
this.ctx = ctx;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `POST /v1/files` — multipart upload. Returns the file's breadcrumb.
|
|
17
|
+
*
|
|
18
|
+
* Accepts a `File` (browser), `Blob`, or anything FormData takes.
|
|
19
|
+
*/
|
|
20
|
+
async upload(file, opts = {}) {
|
|
21
|
+
const form = new FormData();
|
|
22
|
+
if (opts.filename)
|
|
23
|
+
form.append('file', file, opts.filename);
|
|
24
|
+
else
|
|
25
|
+
form.append('file', file);
|
|
26
|
+
form.append('scope', opts.scope ?? 'tenant');
|
|
27
|
+
const res = await request(this.ctx, '/v1/files', {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
rawBody: form,
|
|
30
|
+
});
|
|
31
|
+
return 'breadcrumb' in res && res.breadcrumb
|
|
32
|
+
? res.breadcrumb
|
|
33
|
+
: res;
|
|
34
|
+
}
|
|
35
|
+
/** `GET /v1/files` — file breadcrumbs visible at the given scope. */
|
|
36
|
+
async list(opts = {}) {
|
|
37
|
+
const res = await request(this.ctx, '/v1/files', {
|
|
38
|
+
query: { scope: opts.scope, limit: opts.limit ?? 50 },
|
|
39
|
+
});
|
|
40
|
+
return Array.isArray(res) ? res : (res?.files ?? []);
|
|
41
|
+
}
|
|
42
|
+
/** `GET /v1/files/{id}` */
|
|
43
|
+
async get(fileId) {
|
|
44
|
+
const res = await request(this.ctx, `/v1/files/${fileId}`);
|
|
45
|
+
return res.file ?? res;
|
|
46
|
+
}
|
|
47
|
+
/** `GET /v1/files/{id}/content` — short-lived signed download URL. */
|
|
48
|
+
async downloadUrl(fileId, expiry = '1h') {
|
|
49
|
+
const res = await request(this.ctx, `/v1/files/${fileId}/content`, {
|
|
50
|
+
query: { expiry },
|
|
51
|
+
});
|
|
52
|
+
return res.download_url;
|
|
53
|
+
}
|
|
54
|
+
/** `GET /v1/files/{id}/text` — extracted text content (PDFs, docs, …). */
|
|
55
|
+
async getText(fileId) {
|
|
56
|
+
const res = await request(this.ctx, `/v1/files/${fileId}/text`);
|
|
57
|
+
return res.text;
|
|
58
|
+
}
|
|
59
|
+
/** `DELETE /v1/files/{id}` */
|
|
60
|
+
async delete(fileId) {
|
|
61
|
+
await request(this.ctx, `/v1/files/${fileId}`, { method: 'DELETE' });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAY9C,MAAM,OAAO,WAAW;IACO;IAA7B,YAA6B,GAAiB;QAAjB,QAAG,GAAH,GAAG,CAAc;IAAG,CAAC;IAElD;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,IAAU,EAAE,OAA0B,EAAE;QACnD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;;YACvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;QAE7C,MAAM,GAAG,GAAG,MAAM,OAAO,CAA2C,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE;YACzF,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;QACH,OAAO,YAAY,IAAK,GAAmC,IAAK,GAAmC,CAAC,UAAU;YAC5G,CAAC,CAAE,GAAkC,CAAC,UAAU;YAChD,CAAC,CAAE,GAAkB,CAAC;IAC1B,CAAC;IAED,qEAAqE;IACrE,KAAK,CAAC,IAAI,CAAC,OAA8C,EAAE;QACzD,MAAM,GAAG,GAAG,MAAM,OAAO,CAA0C,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE;YACxF,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE;SACtD,CAAC,CAAC;QACH,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,2BAA2B;IAC3B,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,MAAM,GAAG,GAAG,MAAM,OAAO,CAAqC,IAAI,CAAC,GAAG,EAAE,aAAa,MAAM,EAAE,CAAC,CAAC;QAC/F,OAAQ,GAA6B,CAAC,IAAI,IAAK,GAAkB,CAAC;IACpE,CAAC;IAED,sEAAsE;IACtE,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,MAAM,GAAG,IAAI;QAC7C,MAAM,GAAG,GAAG,MAAM,OAAO,CAA2B,IAAI,CAAC,GAAG,EAAE,aAAa,MAAM,UAAU,EAAE;YAC3F,KAAK,EAAE,EAAE,MAAM,EAAE;SAClB,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,OAAO,CAAC,MAAc;QAC1B,MAAM,GAAG,GAAG,MAAM,OAAO,CAAmB,IAAI,CAAC,GAAG,EAAE,aAAa,MAAM,OAAO,CAAC,CAAC;QAClF,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAED,8BAA8B;IAC9B,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,MAAM,OAAO,CAAO,IAAI,CAAC,GAAG,EAAE,aAAa,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,15 +9,26 @@ export { staticTokenProvider } from './auth.js';
|
|
|
9
9
|
export type { TokenProvider } from './auth.js';
|
|
10
10
|
export { ApiError, SdkError } from './errors.js';
|
|
11
11
|
export type { ApiErrorDetail, KnownErrorCode } from './errors.js';
|
|
12
|
+
export type { RequestOptions } from './internal/fetch.js';
|
|
12
13
|
export { BreadcrumbsModule } from './breadcrumbs.js';
|
|
13
14
|
export { ChatModule } from './chat.js';
|
|
14
15
|
export { CardsModule } from './cards.js';
|
|
15
16
|
export { GrantsModule } from './grants.js';
|
|
16
17
|
export { IdentityModule } from './authn.js';
|
|
17
|
-
export
|
|
18
|
-
export
|
|
18
|
+
export { MarketplaceModule } from './marketplace.js';
|
|
19
|
+
export { OrgModule } from './org.js';
|
|
20
|
+
export { FilesModule } from './files.js';
|
|
21
|
+
export { MembersModule } from './members.js';
|
|
22
|
+
export type { MeResponse, Tenant, TenantMembership, PendingInvitation } from './authn.js';
|
|
23
|
+
export type { SendChatRequest, SendChatResponse, ChatAttachmentRef, SseStreamOptions, SessionParticipant, ChattableAgent, } from './chat.js';
|
|
19
24
|
export type { ServiceGrantSummary, InitiateAuthRequest, InitiateAuthResponse, GrantType, GrantStatus } from './grants.js';
|
|
25
|
+
export type { BundleScope, BundleStatus, BundleItemStatus, BundleItemResult, BundleSummary, } from './marketplace.js';
|
|
26
|
+
export type { OrgSummary, OrgMember, OrgTenant, CustomerOrgResponse, OrgLLMProvider, } from './org.js';
|
|
27
|
+
export type { FileScope, UploadFileOptions } from './files.js';
|
|
28
|
+
export type { TenantMember, TenantInvitation } from './members.js';
|
|
20
29
|
export type { Actor, ActorType, Breadcrumb, BreadcrumbResponse, CreateBreadcrumbRequest, UpdateBreadcrumbRequest, QueryByTagsOptions, SemanticSearchOptions, } from './types/breadcrumb.js';
|
|
30
|
+
export { parseModelAddress, formatModelAddress, isTierAddress, ROUTE_TIER, } from './types/engine.js';
|
|
31
|
+
export type { EngineConfig, ModelAddress, IntelligenceTier, } from './types/engine.js';
|
|
21
32
|
export type { Card, CardLayout, CardHeader, CardBody, CardFooter, CardAction, ActionStyle, Row, TextRow, FlexibleTextRow, ClaimRow, MetricRow, EventRow, PersonRow, PlaceRow, ToggleRow, DraftPreviewRow, ChartRow, ChartSpec, TrendDirection, DraftPreview, InputSpec, RatingSpec, ProgressState, ConnectDetails, CompareColumn, ResolveRequest, CanonicalStatus, } from './types/card.js';
|
|
22
33
|
export type { SseConnection, SseHandlers, SseDelta, SseThought, SseAction, SseError, } from './internal/sse.js';
|
|
23
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WA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M,YAAY,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGnE,YAAY,EACV,KAAK,EACL,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,GAAG,EACH,OAAO,EACP,eAAe,EACf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,GACT,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,4 +15,10 @@ export { ChatModule } from './chat.js';
|
|
|
15
15
|
export { CardsModule } from './cards.js';
|
|
16
16
|
export { GrantsModule } from './grants.js';
|
|
17
17
|
export { IdentityModule } from './authn.js';
|
|
18
|
+
export { MarketplaceModule } from './marketplace.js';
|
|
19
|
+
export { OrgModule } from './org.js';
|
|
20
|
+
export { FilesModule } from './files.js';
|
|
21
|
+
export { MembersModule } from './members.js';
|
|
22
|
+
// LLM engine selection — canonical route/provider/model address (runtime SSOT)
|
|
23
|
+
export { parseModelAddress, formatModelAddress, isTierAddress, ROUTE_TIER, } from './types/engine.js';
|
|
18
24
|
//# 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;;;;GAIG;AAEH,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO;AACP,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,SAAS;AACT,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO;AACP,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,SAAS;AACT,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMjD,uDAAuD;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAwC7C,+EAA+E;AAC/E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC"}
|
package/dist/internal/fetch.d.ts
CHANGED
|
@@ -20,6 +20,12 @@ export interface RequestOptions {
|
|
|
20
20
|
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
21
21
|
/** JSON body; will be serialised. */
|
|
22
22
|
body?: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Raw body passed straight to fetch (FormData, Blob, string, …).
|
|
25
|
+
* Mutually exclusive with `body`; no Content-Type header is set so
|
|
26
|
+
* the runtime can add its own (e.g. multipart boundaries).
|
|
27
|
+
*/
|
|
28
|
+
rawBody?: BodyInit;
|
|
23
29
|
/** Extra query params. */
|
|
24
30
|
query?: Record<string, string | number | boolean | undefined | null | Array<string | number | boolean>>;
|
|
25
31
|
/** Extra headers. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/internal/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrD,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IACxG,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAA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AAM,CAAC,CAAC;IACjC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC,CAAC;CAChE;AAED,wBAAsB,OAAO,CAAC,CAAC,GAAG,OAAO,EACvC,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,CAAC,CAAC,CAsEZ"}
|
package/dist/internal/fetch.js
CHANGED
|
@@ -36,6 +36,8 @@ export async function request(ctx, path, options = {}) {
|
|
|
36
36
|
const init = { method, headers };
|
|
37
37
|
if (body !== undefined)
|
|
38
38
|
init.body = JSON.stringify(body);
|
|
39
|
+
else if (options.rawBody !== undefined)
|
|
40
|
+
init.body = options.rawBody;
|
|
39
41
|
if (options.signal)
|
|
40
42
|
init.signal = options.signal;
|
|
41
43
|
const res = await fetchImpl(url, init);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/internal/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/internal/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAoClE,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,GAAiB,EACjB,IAAY,EACZ,UAA0B,EAAE;IAE5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAA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BACrB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;wBACxC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzC,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marketplace module — bundle catalogue, install state and lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the gateway's `/v1/marketplace/*` surface:
|
|
5
|
+
*
|
|
6
|
+
* GET /v1/marketplace/bundles list catalogue bundles
|
|
7
|
+
* GET /v1/marketplace/bundles/{scope}/{bundle} one bundle definition
|
|
8
|
+
* GET /v1/marketplace/bundles/{scope}/{bundle}/status install status in this workspace
|
|
9
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/install install into this workspace
|
|
10
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/update upgrade install to latest published
|
|
11
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/repair re-install drifted items
|
|
12
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/prune remove items dropped from the bundle
|
|
13
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/uninstall remove the install
|
|
14
|
+
* GET /v1/marketplace/installed/bundles all bundle installs in this workspace
|
|
15
|
+
*
|
|
16
|
+
* All calls run against the client's current tenant — use
|
|
17
|
+
* `client.forTenant(id)` for fleet fan-out across workspaces.
|
|
18
|
+
*/
|
|
19
|
+
import type { FetchContext } from './internal/fetch.js';
|
|
20
|
+
/** Where a marketplace bundle is published. */
|
|
21
|
+
export type BundleScope = 'platform' | 'org' | 'tenant';
|
|
22
|
+
/** Per-item state inside a bundle install. */
|
|
23
|
+
export interface BundleItemStatus {
|
|
24
|
+
name: string;
|
|
25
|
+
/** e.g. current | drifted | missing */
|
|
26
|
+
status: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One bundle's install state in the active workspace, as returned by
|
|
30
|
+
* `GET /v1/marketplace/installed/bundles` and `.../status`.
|
|
31
|
+
*/
|
|
32
|
+
export interface BundleStatus {
|
|
33
|
+
bundle_name: string;
|
|
34
|
+
/** current | update_available | drifted | prune_available | not_installed | … */
|
|
35
|
+
status: string;
|
|
36
|
+
installed?: boolean;
|
|
37
|
+
effective_source?: {
|
|
38
|
+
display_name?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
scope?: string;
|
|
41
|
+
};
|
|
42
|
+
install_record?: {
|
|
43
|
+
installed_version?: string;
|
|
44
|
+
source_scope?: string;
|
|
45
|
+
};
|
|
46
|
+
item_statuses?: BundleItemStatus[];
|
|
47
|
+
missing_item_names?: string[];
|
|
48
|
+
removed_item_names?: string[];
|
|
49
|
+
}
|
|
50
|
+
/** Per-item outcome of an install / update / repair call. */
|
|
51
|
+
export interface BundleItemResult {
|
|
52
|
+
name: string;
|
|
53
|
+
/** created | updated | platform (skipped — platform-scope copy exists) | error */
|
|
54
|
+
status: string;
|
|
55
|
+
error?: string;
|
|
56
|
+
}
|
|
57
|
+
/** A catalogue bundle (`GET /v1/marketplace/bundles`). */
|
|
58
|
+
export interface BundleSummary {
|
|
59
|
+
name: string;
|
|
60
|
+
scope: string;
|
|
61
|
+
display_name?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
version?: string;
|
|
64
|
+
item_count?: number;
|
|
65
|
+
items?: Array<{
|
|
66
|
+
name: string;
|
|
67
|
+
kind?: string;
|
|
68
|
+
}>;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
export declare class MarketplaceModule {
|
|
72
|
+
private readonly ctx;
|
|
73
|
+
constructor(ctx: FetchContext);
|
|
74
|
+
/** All bundle installs in the active workspace, with version/drift status. */
|
|
75
|
+
listInstalledBundles(): Promise<BundleStatus[]>;
|
|
76
|
+
/** Catalogue of bundles visible from the active workspace. */
|
|
77
|
+
listBundles(): Promise<BundleSummary[]>;
|
|
78
|
+
/** One bundle's definition. */
|
|
79
|
+
getBundle(scope: BundleScope, bundle: string): Promise<BundleSummary>;
|
|
80
|
+
/** Install status of one bundle in the active workspace. */
|
|
81
|
+
bundleStatus(scope: BundleScope, bundle: string): Promise<BundleStatus>;
|
|
82
|
+
/** Install a bundle into the active workspace. */
|
|
83
|
+
installBundle(scope: BundleScope, bundle: string): Promise<BundleItemResult[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Upgrade an installed bundle to the latest published version.
|
|
86
|
+
* Items that also exist at platform scope are skipped (status
|
|
87
|
+
* `"platform"`), so callers can detect no-op updates.
|
|
88
|
+
*/
|
|
89
|
+
updateBundle(scope: BundleScope, bundle: string): Promise<BundleItemResult[]>;
|
|
90
|
+
/** Re-install drifted items from the published source. */
|
|
91
|
+
repairBundle(scope: BundleScope, bundle: string): Promise<BundleItemResult[]>;
|
|
92
|
+
/** Remove installed items that were dropped from the bundle definition. */
|
|
93
|
+
pruneBundle(scope: BundleScope, bundle: string): Promise<BundleItemResult[]>;
|
|
94
|
+
/** Uninstall a bundle from the active workspace. */
|
|
95
|
+
uninstallBundle(scope: BundleScope, bundle: string): Promise<BundleItemResult[]>;
|
|
96
|
+
private lifecycle;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=marketplace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../src/marketplace.ts"],"names":[],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
|
|
|
1
|
+
/**
|
|
2
|
+
* Marketplace module — bundle catalogue, install state and lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the gateway's `/v1/marketplace/*` surface:
|
|
5
|
+
*
|
|
6
|
+
* GET /v1/marketplace/bundles list catalogue bundles
|
|
7
|
+
* GET /v1/marketplace/bundles/{scope}/{bundle} one bundle definition
|
|
8
|
+
* GET /v1/marketplace/bundles/{scope}/{bundle}/status install status in this workspace
|
|
9
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/install install into this workspace
|
|
10
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/update upgrade install to latest published
|
|
11
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/repair re-install drifted items
|
|
12
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/prune remove items dropped from the bundle
|
|
13
|
+
* POST /v1/marketplace/bundles/{scope}/{bundle}/uninstall remove the install
|
|
14
|
+
* GET /v1/marketplace/installed/bundles all bundle installs in this workspace
|
|
15
|
+
*
|
|
16
|
+
* All calls run against the client's current tenant — use
|
|
17
|
+
* `client.forTenant(id)` for fleet fan-out across workspaces.
|
|
18
|
+
*/
|
|
19
|
+
import { request } from './internal/fetch.js';
|
|
20
|
+
export class MarketplaceModule {
|
|
21
|
+
ctx;
|
|
22
|
+
constructor(ctx) {
|
|
23
|
+
this.ctx = ctx;
|
|
24
|
+
}
|
|
25
|
+
/** All bundle installs in the active workspace, with version/drift status. */
|
|
26
|
+
async listInstalledBundles() {
|
|
27
|
+
const res = await request(this.ctx, '/v1/marketplace/installed/bundles');
|
|
28
|
+
return Array.isArray(res) ? res : (res?.bundles ?? []);
|
|
29
|
+
}
|
|
30
|
+
/** Catalogue of bundles visible from the active workspace. */
|
|
31
|
+
async listBundles() {
|
|
32
|
+
const res = await request(this.ctx, '/v1/marketplace/bundles');
|
|
33
|
+
return Array.isArray(res) ? res : (res?.bundles ?? []);
|
|
34
|
+
}
|
|
35
|
+
/** One bundle's definition. */
|
|
36
|
+
async getBundle(scope, bundle) {
|
|
37
|
+
return request(this.ctx, `/v1/marketplace/bundles/${scope}/${encodeURIComponent(bundle)}`);
|
|
38
|
+
}
|
|
39
|
+
/** Install status of one bundle in the active workspace. */
|
|
40
|
+
async bundleStatus(scope, bundle) {
|
|
41
|
+
return request(this.ctx, `/v1/marketplace/bundles/${scope}/${encodeURIComponent(bundle)}/status`);
|
|
42
|
+
}
|
|
43
|
+
/** Install a bundle into the active workspace. */
|
|
44
|
+
async installBundle(scope, bundle) {
|
|
45
|
+
return this.lifecycle(scope, bundle, 'install');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Upgrade an installed bundle to the latest published version.
|
|
49
|
+
* Items that also exist at platform scope are skipped (status
|
|
50
|
+
* `"platform"`), so callers can detect no-op updates.
|
|
51
|
+
*/
|
|
52
|
+
async updateBundle(scope, bundle) {
|
|
53
|
+
return this.lifecycle(scope, bundle, 'update');
|
|
54
|
+
}
|
|
55
|
+
/** Re-install drifted items from the published source. */
|
|
56
|
+
async repairBundle(scope, bundle) {
|
|
57
|
+
return this.lifecycle(scope, bundle, 'repair');
|
|
58
|
+
}
|
|
59
|
+
/** Remove installed items that were dropped from the bundle definition. */
|
|
60
|
+
async pruneBundle(scope, bundle) {
|
|
61
|
+
return this.lifecycle(scope, bundle, 'prune');
|
|
62
|
+
}
|
|
63
|
+
/** Uninstall a bundle from the active workspace. */
|
|
64
|
+
async uninstallBundle(scope, bundle) {
|
|
65
|
+
return this.lifecycle(scope, bundle, 'uninstall');
|
|
66
|
+
}
|
|
67
|
+
async lifecycle(scope, bundle, action) {
|
|
68
|
+
const res = await request(this.ctx, `/v1/marketplace/bundles/${scope}/${encodeURIComponent(bundle)}/${action}`, { method: 'POST', body: {} });
|
|
69
|
+
if (Array.isArray(res))
|
|
70
|
+
return res;
|
|
71
|
+
return res?.items ?? [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=marketplace.js.map
|
|
@@ -0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
|
4
|
+
* GET/POST /v1/tenants/{tenant_id}/members
|
|
5
|
+
* PUT/DELETE /v1/tenants/{tenant_id}/members/{user_id}
|
|
6
|
+
* GET/POST /v1/tenants/{tenant_id}/invitations
|
|
7
|
+
* DELETE /v1/tenants/{tenant_id}/invitations/{invitation_id}
|
|
8
|
+
*
|
|
9
|
+
* Accept/decline/pending live on the IdentityModule (`auth.*`) because
|
|
10
|
+
* they are keyed by the *caller's* email, not a workspace.
|
|
11
|
+
*
|
|
12
|
+
* Note: creating an invitation also sends the invite email server-side;
|
|
13
|
+
* there is no separate "resend" endpoint — re-create to resend.
|
|
14
|
+
*/
|
|
15
|
+
import type { FetchContext } from './internal/fetch.js';
|
|
16
|
+
export interface TenantMember {
|
|
17
|
+
id: string;
|
|
18
|
+
email: string;
|
|
19
|
+
name: string;
|
|
20
|
+
avatar_url?: string | null;
|
|
21
|
+
role: string;
|
|
22
|
+
joined_at: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TenantInvitation {
|
|
25
|
+
id: string;
|
|
26
|
+
email: string;
|
|
27
|
+
role: string;
|
|
28
|
+
status: 'pending' | 'accepted' | 'declined' | 'expired' | 'cancelled' | string;
|
|
29
|
+
created_at?: string;
|
|
30
|
+
expires_at?: string | null;
|
|
31
|
+
invited_by_name?: string | null;
|
|
32
|
+
invited_by_email?: string | null;
|
|
33
|
+
}
|
|
34
|
+
export declare class MembersModule {
|
|
35
|
+
private readonly ctx;
|
|
36
|
+
constructor(ctx: FetchContext);
|
|
37
|
+
private tenant;
|
|
38
|
+
/** `GET /v1/tenants/{id}/members` */
|
|
39
|
+
list(tenantId?: string): Promise<TenantMember[]>;
|
|
40
|
+
/** `POST /v1/tenants/{id}/members` — direct add (caller must know the user id). */
|
|
41
|
+
add(userId: string, role: string, tenantId?: string): Promise<void>;
|
|
42
|
+
/** `PUT /v1/tenants/{id}/members/{userId}` — change a member's role. */
|
|
43
|
+
updateRole(userId: string, role: string, tenantId?: string): Promise<void>;
|
|
44
|
+
/** `DELETE /v1/tenants/{id}/members/{userId}` */
|
|
45
|
+
remove(userId: string, tenantId?: string): Promise<void>;
|
|
46
|
+
/** `GET /v1/tenants/{id}/invitations` — all invitations incl. resolved ones. */
|
|
47
|
+
listInvitations(tenantId?: string): Promise<TenantInvitation[]>;
|
|
48
|
+
/**
|
|
49
|
+
* `POST /v1/tenants/{id}/invitations` — creates the invite AND sends
|
|
50
|
+
* the email. Role defaults server-side to 'member'.
|
|
51
|
+
*/
|
|
52
|
+
invite(email: string, options?: {
|
|
53
|
+
role?: string;
|
|
54
|
+
message?: string;
|
|
55
|
+
tenantId?: string;
|
|
56
|
+
}): Promise<TenantInvitation>;
|
|
57
|
+
/** `DELETE /v1/tenants/{id}/invitations/{invId}` — soft-cancel (status → cancelled). */
|
|
58
|
+
cancelInvitation(invitationId: string, tenantId?: string): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../src/members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB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