@01.software/sdk 0.16.0 → 0.17.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 +24 -19
- package/dist/{const-RMD3ZVaS.d.ts → const-D2K5HxpP.d.cts} +2 -2
- package/dist/{const-BLwHrFZ-.d.cts → const-DG8TrouX.d.ts} +2 -2
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-DRvL_bS2.d.cts → payload-types-CMoyAOjJ.d.cts} +142 -78
- package/dist/{payload-types-DRvL_bS2.d.ts → payload-types-CMoyAOjJ.d.ts} +142 -78
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/{webhook-CIcWL95t.d.cts → webhook-Dm2zz7FQ.d.cts} +2 -2
- package/dist/{webhook-7_KR18M-.d.ts → webhook-IhuUWnt5.d.ts} +2 -2
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ const { docs } = await client.collections.from('products').find({
|
|
|
79
79
|
import { createServerClient } from '@01.software/sdk'
|
|
80
80
|
|
|
81
81
|
const client = createServerClient({
|
|
82
|
-
publishableKey: process.env.
|
|
82
|
+
publishableKey: process.env.SOFTWARE_PUBLISHABLE_KEY,
|
|
83
83
|
secretKey: process.env.SOFTWARE_SECRET_KEY, // sk01_... opaque API key from Console
|
|
84
84
|
})
|
|
85
85
|
|
|
@@ -113,7 +113,7 @@ const client = createClient({
|
|
|
113
113
|
const server = createServerClient({
|
|
114
114
|
publishableKey: string,
|
|
115
115
|
secretKey: string, // sk01_... or pat01_...
|
|
116
|
-
tenantId
|
|
116
|
+
tenantId?: string, // for PAT workflows, must match the pinned tenant when supplied
|
|
117
117
|
})
|
|
118
118
|
```
|
|
119
119
|
|
|
@@ -121,6 +121,7 @@ const server = createServerClient({
|
|
|
121
121
|
| ---------------- | -------- | ---------------------------- |
|
|
122
122
|
| `publishableKey` | `string` | API publishable key |
|
|
123
123
|
| `secretKey` | `string` | API secret key (server only) |
|
|
124
|
+
| `tenantId` | `string` | Optional generally; required when a PAT must disambiguate multi-tenant access. Must match the pinned tenant when supplied. |
|
|
124
125
|
|
|
125
126
|
API URL은 환경변수로 오버라이드 가능합니다:
|
|
126
127
|
|
|
@@ -464,22 +465,25 @@ const handler = createTypedWebhookHandler('orders', async (event) => {
|
|
|
464
465
|
|
|
465
466
|
## Supported Collections
|
|
466
467
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
|
470
|
-
|
|
|
471
|
-
|
|
|
472
|
-
|
|
|
473
|
-
|
|
|
474
|
-
|
|
|
475
|
-
|
|
|
476
|
-
|
|
|
477
|
-
|
|
|
478
|
-
|
|
|
479
|
-
|
|
|
480
|
-
|
|
|
481
|
-
|
|
|
482
|
-
|
|
|
468
|
+
Source of truth: `packages/sdk/src/core/collection/const.ts` (`COLLECTIONS`: 70).
|
|
469
|
+
|
|
470
|
+
| Category | Collections |
|
|
471
|
+
| --- | --- |
|
|
472
|
+
| Tenant | `tenants`, `tenant-metadata`, `tenant-logos` |
|
|
473
|
+
| Products | `products`, `product-variants`, `product-options`, `product-option-values`, `product-categories`, `product-tags`, `product-collections`, `brands`, `brand-logos` |
|
|
474
|
+
| Orders | `orders`, `order-items`, `returns`, `return-items`, `fulfillments`, `fulfillment-items`, `transactions` |
|
|
475
|
+
| Customers | `customers`, `customer-profiles`, `customer-addresses`, `customer-groups` |
|
|
476
|
+
| Carts | `carts`, `cart-items` |
|
|
477
|
+
| Commerce | `discounts`, `promotions`, `shipping-policies` |
|
|
478
|
+
| Content | `documents`, `document-categories`, `document-types`, `posts`, `post-authors`, `post-categories`, `post-tags`, `links`, `link-categories`, `link-tags` |
|
|
479
|
+
| Playlists / Tracks | `playlists`, `playlist-categories`, `playlist-tags`, `tracks`, `track-categories`, `track-tags` |
|
|
480
|
+
| Galleries | `galleries`, `gallery-categories`, `gallery-tags`, `gallery-items` |
|
|
481
|
+
| Canvas | `canvases`, `canvas-node-types`, `canvas-edge-types`, `canvas-categories`, `canvas-tags`, `canvas-nodes`, `canvas-edges` |
|
|
482
|
+
| Videos | `videos`, `video-categories`, `video-tags` |
|
|
483
|
+
| Live Streams | `live-streams` |
|
|
484
|
+
| Media | `images` |
|
|
485
|
+
| Forms | `forms`, `form-submissions` |
|
|
486
|
+
| Community | `threads`, `comments`, `reactions`, `reaction-types`, `bookmarks`, `thread-categories`, `reports`, `community-bans` |
|
|
483
487
|
|
|
484
488
|
## Utilities
|
|
485
489
|
|
|
@@ -581,6 +585,7 @@ Error classes: `SDKError`, `ApiError`, `NetworkError`, `ValidationError`, `Confi
|
|
|
581
585
|
|
|
582
586
|
```bash
|
|
583
587
|
NEXT_PUBLIC_SOFTWARE_PUBLISHABLE_KEY=your_publishable_key
|
|
588
|
+
SOFTWARE_PUBLISHABLE_KEY=your_publishable_key
|
|
584
589
|
SOFTWARE_SECRET_KEY=sk01_... # Server only — opaque API key from Console
|
|
585
590
|
```
|
|
586
591
|
|
|
@@ -597,7 +602,7 @@ New error codes propagated via `SDKError.code` (no breaking change; existing cal
|
|
|
597
602
|
| Code | Phase | Trigger |
|
|
598
603
|
|---|---|---|
|
|
599
604
|
| `account_suspended` | P1 | Suspended session / `sk01_` / `pat01_` / customer JWT — 401 |
|
|
600
|
-
| `pat_tenant_header_forbidden` | P1 | `pat01_` with `X-Tenant-Id` header — 401
|
|
605
|
+
| `pat_tenant_header_forbidden` | P1 | `pat01_` request with a forbidden or mismatched `X-Tenant-Id` header — 401 |
|
|
601
606
|
| `tenant_mismatch` | P3 | Cross-tenant FK rejection (forms / community / orders) |
|
|
602
607
|
| `server_derived` | P3 | Body-driven write into a server-derived state field — 422 |
|
|
603
608
|
| `scope_denied` | P5 | `pat01_` whose `ApiKeys.scopes` lacks the operation |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Config } from './payload-types-
|
|
1
|
+
import { C as Config } from './payload-types-CMoyAOjJ.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection type derived from Payload Config.
|
|
@@ -14,7 +14,7 @@ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-lo
|
|
|
14
14
|
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
15
15
|
* This is the single source of truth for which collections are publicly accessible via SDK.
|
|
16
16
|
*/
|
|
17
|
-
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "posts", "post-authors", "post-categories", "post-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "threads", "comments", "reactions", "reaction-types", "bookmarks", "thread-categories", "reports", "community-bans"];
|
|
17
|
+
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "posts", "post-authors", "post-categories", "post-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "threads", "comments", "reactions", "reaction-types", "bookmarks", "thread-categories", "reports", "community-bans"];
|
|
18
18
|
/**
|
|
19
19
|
* Public collections available for SDK access.
|
|
20
20
|
* Derived from the COLLECTIONS array (single source of truth).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Config } from './payload-types-
|
|
1
|
+
import { C as Config } from './payload-types-CMoyAOjJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Collection type derived from Payload Config.
|
|
@@ -14,7 +14,7 @@ declare const INTERNAL_COLLECTIONS: readonly ["users", "payload-kv", "payload-lo
|
|
|
14
14
|
* Array of all public collection names for runtime use (e.g., Zod enum validation).
|
|
15
15
|
* This is the single source of truth for which collections are publicly accessible via SDK.
|
|
16
16
|
*/
|
|
17
|
-
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "posts", "post-authors", "post-categories", "post-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "threads", "comments", "reactions", "reaction-types", "bookmarks", "thread-categories", "reports", "community-bans"];
|
|
17
|
+
declare const COLLECTIONS: readonly ["tenants", "tenant-metadata", "tenant-logos", "products", "product-variants", "product-options", "product-option-values", "product-categories", "product-tags", "product-collections", "brands", "brand-logos", "orders", "order-items", "returns", "return-items", "fulfillments", "fulfillment-items", "transactions", "customers", "customer-profiles", "customer-addresses", "customer-groups", "carts", "cart-items", "discounts", "promotions", "shipping-policies", "documents", "document-categories", "document-types", "posts", "post-authors", "post-categories", "post-tags", "playlists", "playlist-categories", "playlist-tags", "tracks", "track-categories", "track-tags", "galleries", "gallery-categories", "gallery-tags", "gallery-items", "links", "link-categories", "link-tags", "canvases", "canvas-node-types", "canvas-edge-types", "canvas-categories", "canvas-tags", "canvas-nodes", "canvas-edges", "videos", "video-categories", "video-tags", "live-streams", "images", "forms", "form-submissions", "threads", "comments", "reactions", "reaction-types", "bookmarks", "thread-categories", "reports", "community-bans"];
|
|
18
18
|
/**
|
|
19
19
|
* Public collections available for SDK access.
|
|
20
20
|
* Derived from the COLLECTIONS array (single source of truth).
|