@ingram-cloud/sdk 1.2.0 → 1.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.
Files changed (49) hide show
  1. package/dist/client.js +185 -14
  2. package/dist/index.js +4 -0
  3. package/dist/scopes.js +52 -0
  4. package/dist/zod/_actor.js +33 -0
  5. package/dist/zod/_page.js +18 -4
  6. package/dist/zod/agents.js +17 -3
  7. package/dist/zod/billing.js +136 -0
  8. package/dist/zod/budgets.js +2 -3
  9. package/dist/zod/connections.js +2 -3
  10. package/dist/zod/conversations.js +4 -11
  11. package/dist/zod/deployments.js +32 -0
  12. package/dist/zod/files.js +2 -9
  13. package/dist/zod/index.js +3 -0
  14. package/dist/zod/mcp.js +20 -14
  15. package/dist/zod/observability.js +39 -19
  16. package/dist/zod/projects.js +4 -4
  17. package/dist/zod/runs.js +16 -4
  18. package/dist/zod/schedules.js +2 -7
  19. package/dist/zod/skills.js +73 -0
  20. package/dist/zod/smith-revisions.js +7 -5
  21. package/dist/zod/smiths.js +14 -0
  22. package/dist/zod/tenant.js +41 -4
  23. package/dist/zod/vector-stores.js +36 -23
  24. package/package.json +6 -8
  25. package/ts/client.ts +431 -50
  26. package/ts/index.ts +4 -0
  27. package/ts/responses.ts +40 -2
  28. package/ts/scopes.ts +57 -0
  29. package/ts/zod/.impeccable/hook.cache.json +1 -0
  30. package/ts/zod/_actor.ts +36 -0
  31. package/ts/zod/_page.ts +19 -4
  32. package/ts/zod/agents.ts +17 -3
  33. package/ts/zod/billing.ts +168 -0
  34. package/ts/zod/budgets.ts +2 -3
  35. package/ts/zod/connections.ts +2 -3
  36. package/ts/zod/conversations.ts +7 -11
  37. package/ts/zod/deployments.ts +36 -0
  38. package/ts/zod/files.ts +2 -9
  39. package/ts/zod/index.ts +3 -0
  40. package/ts/zod/mcp.ts +20 -15
  41. package/ts/zod/observability.ts +75 -24
  42. package/ts/zod/projects.ts +4 -4
  43. package/ts/zod/runs.ts +18 -4
  44. package/ts/zod/schedules.ts +2 -7
  45. package/ts/zod/skills.ts +85 -0
  46. package/ts/zod/smith-revisions.ts +7 -5
  47. package/ts/zod/smiths.ts +14 -0
  48. package/ts/zod/tenant.ts +52 -5
  49. package/ts/zod/vector-stores.ts +41 -23
@@ -7,13 +7,16 @@
7
7
  * filter grammar, and the `search_results.page` envelope are OpenAI's, wart for
8
8
  * wart (modify is `POST`, the batch object is `vector_store.files_batch`, the
9
9
  * search page uses a `next_page` token while CRUD lists use `first_id`/
10
- * `last_id`). `smith_id` is the one documented IC extension: it scopes a store
11
- * to a single smith ("" = tenant-wide), the same isolation boundary every other
12
- * smith-owned resource has. Expiration policies (`expires_after`), query
10
+ * `last_id`). Two documented IC extensions: `smith_id` scopes a store to a
11
+ * single smith ("" = tenant-wide), the same isolation boundary every other
12
+ * smith-owned resource has; `embedding_model` names the store's embedder,
13
+ * frozen at create (OpenAI pins one platform-wide, Gemini's File Search exposes
14
+ * it the same way). Expiration policies (`expires_after`), query
13
15
  * rewriting, and rankers are not implemented — the fields don't exist here
14
16
  * rather than being accepted and ignored.
15
17
  */
16
18
  import { z } from "zod";
19
+ import { oaiListOut } from "./_page.js";
17
20
  // ── Chunking ─────────────────────────────────────────────────────────────────
18
21
  /** Static chunking params. Overlap must not exceed half the chunk size. */
19
22
  export const StaticChunkingConfig = z
@@ -45,7 +48,9 @@ export const ChunkingStrategyOut = z
45
48
  /** File attributes: ≤16 keys, key ≤64 chars, value string(≤512)|number|bool. */
46
49
  export const VectorStoreAttributes = z
47
50
  .record(z.string().max(64), z.union([z.string().max(512), z.number(), z.boolean()]))
48
- .refine((v) => Object.keys(v).length <= 16, { message: "at most 16 attribute keys" });
51
+ .refine((v) => Object.keys(v).length <= 16, {
52
+ message: "at most 16 attribute keys",
53
+ });
49
54
  /** A filter node: a comparison (`type` eq/ne/gt/gte/lt/lte/in/nin over `key`/
50
55
  * `value`) or a compound (`type` and/or over nested `filters`). The grammar is
51
56
  * recursive; the schema validates one node and the API validates nested nodes
@@ -78,6 +83,11 @@ export const VectorStoreIn = z
78
83
  metadata: z.record(z.string(), z.unknown()).optional(),
79
84
  /** IC extension: own the store to one smith ("" / omitted = tenant-wide). */
80
85
  smith_id: z.string().optional(),
86
+ /** IC extension: the embedder to index and query this store with, frozen at
87
+ * create (omitted = the platform default). Any model your OpenAI-provider
88
+ * key can reach — including an EU-hosted OpenAI-compatible endpoint set as
89
+ * that key's `base_url` — of at most 1536 dimensions. */
90
+ embedding_model: z.string().optional(),
81
91
  })
82
92
  .meta({ id: "VectorStoreIn" });
83
93
  export const VectorStoreFileCounts = z.object({
@@ -105,18 +115,13 @@ export const VectorStoreOut = z
105
115
  metadata: z.record(z.string(), z.unknown()),
106
116
  /** IC extension: the owning smith ("" = tenant-wide). */
107
117
  smith_id: z.string(),
118
+ /** IC extension: the embedder this store is indexed and queried with,
119
+ * frozen at create. */
120
+ embedding_model: z.string(),
108
121
  })
109
122
  .meta({ id: "VectorStoreOut" });
110
123
  /** Vector stores, in OpenAI's `list` envelope. */
111
- export const VectorStoreListOut = z
112
- .object({
113
- object: z.literal("list"),
114
- data: z.array(VectorStoreOut),
115
- first_id: z.string().nullable(),
116
- last_id: z.string().nullable(),
117
- has_more: z.boolean(),
118
- })
119
- .meta({ id: "VectorStoreListOut" });
124
+ export const VectorStoreListOut = oaiListOut(VectorStoreOut, "VectorStoreListOut");
120
125
  /** Modify body (OpenAI uses `POST`, not `PATCH`). */
121
126
  export const VectorStorePatch = z
122
127
  .object({
@@ -151,7 +156,12 @@ export const VectorStoreFileOut = z
151
156
  status: z.enum(["in_progress", "completed", "failed", "cancelled"]),
152
157
  last_error: z
153
158
  .object({
154
- code: z.enum(["server_error", "unsupported_file", "invalid_file"]),
159
+ code: z.enum([
160
+ "server_error",
161
+ "unsupported_file",
162
+ "no_text_layer",
163
+ "invalid_file",
164
+ ]),
155
165
  message: z.string(),
156
166
  })
157
167
  .nullable(),
@@ -159,21 +169,24 @@ export const VectorStoreFileOut = z
159
169
  attributes: VectorStoreAttributes.nullable(),
160
170
  })
161
171
  .meta({ id: "VectorStoreFileOut" });
162
- export const VectorStoreFileListOut = z
163
- .object({
164
- object: z.literal("list"),
165
- data: z.array(VectorStoreFileOut),
166
- first_id: z.string().nullable(),
167
- last_id: z.string().nullable(),
168
- has_more: z.boolean(),
169
- })
170
- .meta({ id: "VectorStoreFileListOut" });
172
+ export const VectorStoreFileListOut = oaiListOut(VectorStoreFileOut, "VectorStoreFileListOut");
171
173
  /** Update body: attributes only (chunking is frozen once indexed). */
172
174
  export const VectorStoreFileUpdate = z
173
175
  .object({
174
176
  attributes: VectorStoreAttributes.nullable(),
175
177
  })
176
178
  .meta({ id: "VectorStoreFileUpdate" });
179
+ /** The parsed text a file was indexed as, chunk by chunk, in OpenAI's
180
+ * `vector_store.file_content.page` envelope. The whole file is one page — the
181
+ * paging fields are the envelope's shape, not a promise of more. */
182
+ export const VectorStoreFileContentOut = z
183
+ .object({
184
+ object: z.literal("vector_store.file_content.page"),
185
+ data: z.array(z.object({ type: z.literal("text"), text: z.string() })),
186
+ has_more: z.literal(false),
187
+ next_page: z.null(),
188
+ })
189
+ .meta({ id: "VectorStoreFileContentOut" });
177
190
  export const VectorStoreFileDeleted = z
178
191
  .object({
179
192
  id: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-cloud/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.5.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
  "license": "MIT",
6
6
  "type": "module",
@@ -51,15 +51,13 @@
51
51
  "scripts": {
52
52
  "build": "tsc -p tsconfig.build.json",
53
53
  "typecheck": "tsc --noEmit",
54
- "lint": "oxlint",
55
- "format": "oxfmt --write .",
56
- "prepublishOnly": "bun run build"
54
+ "lint": "nk lint",
55
+ "format": "nk format",
56
+ "prepublishOnly": "bun run build",
57
+ "check": "nk check"
57
58
  },
58
59
  "devDependencies": {
59
- "@ingram-tech/oxlint-config": "^0.2.2",
60
- "oxfmt": "^0.58.0",
61
- "oxlint": "^1.73.0",
62
- "typescript": "^6"
60
+ "@ingram-tech/nk-dev": "^0.10.0"
63
61
  },
64
62
  "dependencies": {
65
63
  "zod": "^4.4.3"