@ingram-cloud/sdk 1.7.0 → 1.8.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/dist/client.js +6 -0
- package/dist/zod/projects.js +21 -0
- package/dist/zod/tenant.js +13 -3
- package/package.json +1 -1
- package/ts/client.ts +10 -0
- package/ts/responses.ts +1 -1
- package/ts/zod/projects.ts +25 -0
- package/ts/zod/tenant.ts +13 -3
package/dist/client.js
CHANGED
|
@@ -709,5 +709,11 @@ export class IngramCloud {
|
|
|
709
709
|
delete: (pid, tid, opts) => this.empty("DELETE", `/organization/projects/${enc(pid)}/tokens/${enc(tid)}`, opts),
|
|
710
710
|
},
|
|
711
711
|
},
|
|
712
|
+
/** Third-party apps linked through the authorization server. */
|
|
713
|
+
apps: {
|
|
714
|
+
list: (query, opts) => this.page("/organization/apps", query, opts),
|
|
715
|
+
/** Disconnect: revokes every token the app holds. */
|
|
716
|
+
delete: (id, opts) => this.empty("DELETE", `/organization/apps/${enc(id)}`, opts),
|
|
717
|
+
},
|
|
712
718
|
};
|
|
713
719
|
}
|
package/dist/zod/projects.js
CHANGED
|
@@ -26,6 +26,27 @@ export const ProjectOut = z
|
|
|
26
26
|
})
|
|
27
27
|
.meta({ id: "ProjectOut" });
|
|
28
28
|
export const ProjectListOut = pageOut(ProjectOut, "ProjectListOut");
|
|
29
|
+
/**
|
|
30
|
+
* A third-party app linked to the organization through the authorization
|
|
31
|
+
* server (`GET /oauth/authorize` with no `resource`): one per `(organization,
|
|
32
|
+
* client_id)`, owning the project it runs in. Disconnecting revokes every
|
|
33
|
+
* token the app holds.
|
|
34
|
+
*/
|
|
35
|
+
export const AppInstallOut = z
|
|
36
|
+
.object({
|
|
37
|
+
id: z.string(),
|
|
38
|
+
organization: z.string(),
|
|
39
|
+
/** The app's Client ID Metadata Document URL. */
|
|
40
|
+
client_id: z.string(),
|
|
41
|
+
client_name: z.string(),
|
|
42
|
+
project: z.string(),
|
|
43
|
+
/** The scopes the app's tokens carry, space-separated. */
|
|
44
|
+
scope: z.string(),
|
|
45
|
+
created_at: z.string(),
|
|
46
|
+
revoked_at: z.string().nullable(),
|
|
47
|
+
})
|
|
48
|
+
.meta({ id: "AppInstallOut" });
|
|
49
|
+
export const AppInstallListOut = pageOut(AppInstallOut, "AppInstallListOut");
|
|
29
50
|
/**
|
|
30
51
|
* The secret minted when an org mints a project (tenant-admin) token. Shape
|
|
31
52
|
* matches `mintToken`'s return; the `tenant` module owns the canonical
|
package/dist/zod/tenant.js
CHANGED
|
@@ -263,17 +263,27 @@ export const ProviderIn = z
|
|
|
263
263
|
* `authorize_url`. */
|
|
264
264
|
export const AuthorizeRequestOut = z
|
|
265
265
|
.object({
|
|
266
|
+
/** `connector`: an MCP host connecting to a deployment (the tenant's page
|
|
267
|
+
* completes it naming a smith). `app`: a third-party app linking an
|
|
268
|
+
* organization (the console completes it with an organization token; the
|
|
269
|
+
* grant's subject is the app's project in that organization). */
|
|
270
|
+
kind: z.enum(["connector", "app"]),
|
|
271
|
+
client_id: z.string(),
|
|
266
272
|
client_name: z.string(),
|
|
273
|
+
/** The scopes the client asked for, space-separated (`app` only). */
|
|
274
|
+
scope: z.string(),
|
|
267
275
|
target_name: z.string(),
|
|
276
|
+
/** '' on an `app` request until it is completed. */
|
|
268
277
|
tenant: z.string(),
|
|
269
278
|
resource: z.string(),
|
|
270
279
|
deployment_id: z.string(),
|
|
271
280
|
})
|
|
272
281
|
.meta({ id: "AuthorizeRequestOut" });
|
|
273
|
-
/** Complete the delegated grant
|
|
274
|
-
* smith the end-user authorized
|
|
282
|
+
/** Complete the delegated grant server-to-server. A `connector` request names
|
|
283
|
+
* the smith the end-user authorized; an `app` request carries nothing — the
|
|
284
|
+
* organization is the token's. */
|
|
275
285
|
export const AuthorizeCompleteIn = z
|
|
276
|
-
.object({ smith_id: z.string() })
|
|
286
|
+
.object({ smith_id: z.string().nullish() })
|
|
277
287
|
.meta({ id: "AuthorizeCompleteIn" });
|
|
278
288
|
/** Where the tenant 302s the browser after completing or declining. */
|
|
279
289
|
export const AuthorizeRedirectOut = z
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingram-cloud/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Typed wire contract + management-plane client for the Ingram Cloud API: Zod schemas to validate request/response bodies, TypeScript types for the JSON you read back, SSE/webhook event types, and a typed REST client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
package/ts/client.ts
CHANGED
|
@@ -56,6 +56,7 @@ import type {
|
|
|
56
56
|
ICOrgUsage,
|
|
57
57
|
ICOrgUsageSeries,
|
|
58
58
|
ICProject,
|
|
59
|
+
ICAppInstall,
|
|
59
60
|
ICProvider,
|
|
60
61
|
ICRecallHit,
|
|
61
62
|
ICRun,
|
|
@@ -1690,5 +1691,14 @@ export class IngramCloud {
|
|
|
1690
1691
|
),
|
|
1691
1692
|
},
|
|
1692
1693
|
},
|
|
1694
|
+
|
|
1695
|
+
/** Third-party apps linked through the authorization server. */
|
|
1696
|
+
apps: {
|
|
1697
|
+
list: (query?: PageOpts, opts?: RequestOptions) =>
|
|
1698
|
+
this.page<ICAppInstall>("/organization/apps", query, opts),
|
|
1699
|
+
/** Disconnect: revokes every token the app holds. */
|
|
1700
|
+
delete: (id: string, opts?: RequestOptions) =>
|
|
1701
|
+
this.empty("DELETE", `/organization/apps/${enc(id)}`, opts),
|
|
1702
|
+
},
|
|
1693
1703
|
};
|
|
1694
1704
|
}
|
package/ts/responses.ts
CHANGED
|
@@ -84,7 +84,7 @@ export type {
|
|
|
84
84
|
ICUsageBreakdown,
|
|
85
85
|
ICUsageEvent,
|
|
86
86
|
} from "./zod/observability.js";
|
|
87
|
-
export type { ICProject } from "./zod/projects.js";
|
|
87
|
+
export type { ICProject, ICAppInstall } from "./zod/projects.js";
|
|
88
88
|
export type { ICActor } from "./zod/_actor.js";
|
|
89
89
|
export type {
|
|
90
90
|
ICRun,
|
package/ts/zod/projects.ts
CHANGED
|
@@ -29,6 +29,29 @@ export const ProjectOut = z
|
|
|
29
29
|
|
|
30
30
|
export const ProjectListOut = pageOut(ProjectOut, "ProjectListOut");
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A third-party app linked to the organization through the authorization
|
|
34
|
+
* server (`GET /oauth/authorize` with no `resource`): one per `(organization,
|
|
35
|
+
* client_id)`, owning the project it runs in. Disconnecting revokes every
|
|
36
|
+
* token the app holds.
|
|
37
|
+
*/
|
|
38
|
+
export const AppInstallOut = z
|
|
39
|
+
.object({
|
|
40
|
+
id: z.string(),
|
|
41
|
+
organization: z.string(),
|
|
42
|
+
/** The app's Client ID Metadata Document URL. */
|
|
43
|
+
client_id: z.string(),
|
|
44
|
+
client_name: z.string(),
|
|
45
|
+
project: z.string(),
|
|
46
|
+
/** The scopes the app's tokens carry, space-separated. */
|
|
47
|
+
scope: z.string(),
|
|
48
|
+
created_at: z.string(),
|
|
49
|
+
revoked_at: z.string().nullable(),
|
|
50
|
+
})
|
|
51
|
+
.meta({ id: "AppInstallOut" });
|
|
52
|
+
|
|
53
|
+
export const AppInstallListOut = pageOut(AppInstallOut, "AppInstallListOut");
|
|
54
|
+
|
|
32
55
|
/**
|
|
33
56
|
* The secret minted when an org mints a project (tenant-admin) token. Shape
|
|
34
57
|
* matches `mintToken`'s return; the `tenant` module owns the canonical
|
|
@@ -66,3 +89,5 @@ export const ProjectTokenIn = z
|
|
|
66
89
|
// ── Inferred consumer-facing type ────────────────────────────────────────────
|
|
67
90
|
|
|
68
91
|
export type ICProject = z.infer<typeof ProjectOut>;
|
|
92
|
+
|
|
93
|
+
export type ICAppInstall = z.infer<typeof AppInstallOut>;
|
package/ts/zod/tenant.ts
CHANGED
|
@@ -305,18 +305,28 @@ export const ProviderIn = z
|
|
|
305
305
|
* `authorize_url`. */
|
|
306
306
|
export const AuthorizeRequestOut = z
|
|
307
307
|
.object({
|
|
308
|
+
/** `connector`: an MCP host connecting to a deployment (the tenant's page
|
|
309
|
+
* completes it naming a smith). `app`: a third-party app linking an
|
|
310
|
+
* organization (the console completes it with an organization token; the
|
|
311
|
+
* grant's subject is the app's project in that organization). */
|
|
312
|
+
kind: z.enum(["connector", "app"]),
|
|
313
|
+
client_id: z.string(),
|
|
308
314
|
client_name: z.string(),
|
|
315
|
+
/** The scopes the client asked for, space-separated (`app` only). */
|
|
316
|
+
scope: z.string(),
|
|
309
317
|
target_name: z.string(),
|
|
318
|
+
/** '' on an `app` request until it is completed. */
|
|
310
319
|
tenant: z.string(),
|
|
311
320
|
resource: z.string(),
|
|
312
321
|
deployment_id: z.string(),
|
|
313
322
|
})
|
|
314
323
|
.meta({ id: "AuthorizeRequestOut" });
|
|
315
324
|
|
|
316
|
-
/** Complete the delegated grant
|
|
317
|
-
* smith the end-user authorized
|
|
325
|
+
/** Complete the delegated grant server-to-server. A `connector` request names
|
|
326
|
+
* the smith the end-user authorized; an `app` request carries nothing — the
|
|
327
|
+
* organization is the token's. */
|
|
318
328
|
export const AuthorizeCompleteIn = z
|
|
319
|
-
.object({ smith_id: z.string() })
|
|
329
|
+
.object({ smith_id: z.string().nullish() })
|
|
320
330
|
.meta({ id: "AuthorizeCompleteIn" });
|
|
321
331
|
|
|
322
332
|
/** Where the tenant 302s the browser after completing or declining. */
|