@amigo-ai/platform-sdk 0.27.0 → 0.29.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/api.md +4 -1
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -5
- package/dist/index.mjs.map +3 -3
- package/dist/resources/me.js +46 -0
- package/dist/resources/me.js.map +1 -0
- package/dist/resources/workspaces.js +8 -10
- package/dist/resources/workspaces.js.map +1 -1
- package/dist/types/generated/api.d.ts +172 -118
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/calls.d.ts +16 -9
- package/dist/types/resources/calls.d.ts.map +1 -1
- package/dist/types/resources/functions.d.ts.map +1 -1
- package/dist/types/resources/intake.d.ts.map +1 -1
- package/dist/types/resources/me.d.ts +54 -0
- package/dist/types/resources/me.d.ts.map +1 -0
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/surfaces.d.ts +17 -17
- package/dist/types/resources/surfaces.d.ts.map +1 -1
- package/dist/types/resources/workspaces.d.ts +8 -17
- package/dist/types/resources/workspaces.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { WorkspaceScopedResource, extractData } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Account-scoped operations for the authenticated identity.
|
|
4
|
+
*
|
|
5
|
+
* "Me" is the SDK-side mirror of platform-api's ``/v1/me/...``
|
|
6
|
+
* namespace — operations that act on the caller's own account
|
|
7
|
+
* (workspaces they own, profile info, …) rather than on a specific
|
|
8
|
+
* workspace they're inside of.
|
|
9
|
+
*
|
|
10
|
+
* Workspace creation lives here, NOT on ``client.workspaces``. The
|
|
11
|
+
* legacy ``client.workspaces.createSelfService`` (which posted to
|
|
12
|
+
* ``/v1/workspaces/self-service``) was removed in SDK 0.28.0 because
|
|
13
|
+
* the route shape confused URL-parsing consumers — the developer-console
|
|
14
|
+
* BFF proxy treated the literal ``self-service`` as a workspace_id
|
|
15
|
+
* and sent identity a JWT-refresh request scoped to that string,
|
|
16
|
+
* which 4xx'd before the call ever reached platform-api.
|
|
17
|
+
*
|
|
18
|
+
* Even though the underlying call is account-scoped, this resource
|
|
19
|
+
* extends ``WorkspaceScopedResource`` to inherit ``withOptions`` /
|
|
20
|
+
* iteration helpers / scoped-client wiring. The bound
|
|
21
|
+
* ``workspaceId`` is unused for the routes here — typically a
|
|
22
|
+
* placeholder like ``"_account"`` from the AmigoClient construction.
|
|
23
|
+
*
|
|
24
|
+
* **No workspace context is injected into the HTTP request.** The
|
|
25
|
+
* shared ``PlatformFetch`` middleware does not auto-prefix paths or
|
|
26
|
+
* inject ``X-Workspace-Id``-style headers based on the resource's
|
|
27
|
+
* ``workspaceId`` slot — the URL each method writes is the URL that
|
|
28
|
+
* leaves the client. Pinned by ``tests/resources/me.test.ts``'s
|
|
29
|
+
* exact-URL assertion.
|
|
30
|
+
*/
|
|
31
|
+
export class MeResource extends WorkspaceScopedResource {
|
|
32
|
+
/**
|
|
33
|
+
* Create a workspace owned by the authenticated identity.
|
|
34
|
+
*
|
|
35
|
+
* The caller is bootstrapped as the workspace's owner. Use this
|
|
36
|
+
* method anywhere that previously called
|
|
37
|
+
* ``client.workspaces.createSelfService(body)`` — the request body
|
|
38
|
+
* shape and response are unchanged; only the URL moved.
|
|
39
|
+
*/
|
|
40
|
+
async createWorkspace(body) {
|
|
41
|
+
return extractData(await this.client.POST('/v1/me/workspaces', {
|
|
42
|
+
body,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=me.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me.js","sourceRoot":"","sources":["../../src/resources/me.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,UAAW,SAAQ,uBAAuB;IACrD;;;;;;;OAOG;IACH,KAAK,CAAC,eAAe,CAAC,IAAqD;QACzE,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC1C,IAAI;SACL,CAAC,CACH,CAAA;IACH,CAAC;CACF"}
|
|
@@ -3,18 +3,16 @@ import { WorkspaceScopedResource, extractData } from './base.js';
|
|
|
3
3
|
* Manage Amigo Platform workspaces.
|
|
4
4
|
* Workspaces are the top-level tenancy boundary for all resources.
|
|
5
5
|
*
|
|
6
|
-
* Note: list operates at account level (
|
|
7
|
-
*
|
|
8
|
-
* ``
|
|
9
|
-
*
|
|
6
|
+
* Note: ``list`` operates at account level (``/v1/workspaces``).
|
|
7
|
+
* Creation lives at ``/v1/me/workspaces`` — see ``MeResource``
|
|
8
|
+
* (``client.me.createWorkspace``). The legacy
|
|
9
|
+
* ``POST /v1/workspaces/self-service`` was removed in platform-api
|
|
10
|
+
* PR #2472; ``/v1/workspaces/<x>`` paths now exclusively operate on
|
|
11
|
+
* a specific workspace, so URL-parsing consumers can never confuse
|
|
12
|
+
* an account-level operation with a workspace-scoped one.
|
|
13
|
+
* Get/update/archive/provision operate on a specific workspace.
|
|
10
14
|
*/
|
|
11
15
|
export class WorkspacesResource extends WorkspaceScopedResource {
|
|
12
|
-
/** Create a workspace for the authenticated user and attach owner access */
|
|
13
|
-
async createSelfService(body) {
|
|
14
|
-
return extractData(await this.client.POST('/v1/workspaces/self-service', {
|
|
15
|
-
body,
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
16
|
/** List workspaces accessible to the current API key */
|
|
19
17
|
async list(params) {
|
|
20
18
|
return extractData(await this.client.GET('/v1/workspaces', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAGhE
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAGhE;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB;IAC7D,wDAAwD;IACxD,KAAK,CAAC,IAAI,CAAC,MAAmB;QAC5B,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE;YACtC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;SAC1B,CAAC,CACH,CAAA;IACH,CAAC;IAED,cAAc,CAAC,MAAmB;QAChC,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAA;IACjF,CAAC;IAED,mCAAmC;IACnC,KAAK,CAAC,GAAG,CAAC,EAAyB;QACjC,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,EAAE;YACrD,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;SAC3D,CAAC,CACH,CAAA;IACH,CAAC;IAED,gCAAgC;IAChC,KAAK,CAAC,MAAM,CAAC,IAAqD,EAAE,EAAyB;QAC3F,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE;YACvD,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