@carddb/node 0.2.0 → 0.2.5

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 (2) hide show
  1. package/README.md +29 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -59,6 +59,35 @@ const exchange = await client.decks.exchangeAccessToken({
59
59
  })
60
60
  ```
61
61
 
62
+ ## Publisher Management
63
+
64
+ Use `secretKey` in trusted server runtimes for publisher workflows such as game management, import formats, import jobs, record upserts/deletes, file-backed imports, and exports.
65
+
66
+ ```typescript
67
+ const client = new CardDBClient({ secretKey: process.env.CARDDB_SECRET_KEY })
68
+
69
+ const game = await client.games.create({
70
+ publisherId: 'publisher_uuid',
71
+ key: 'tcg',
72
+ name: 'Example TCG',
73
+ })
74
+
75
+ const upsert = await client.records.upsertBatch({
76
+ gameId: game.id,
77
+ datasetKey: 'cards',
78
+ records: [{ code: 'CARD-001', name: 'Example Card' }],
79
+ })
80
+
81
+ if (upsert.job) {
82
+ await client.imports.waitForJob(upsert.job.id)
83
+ }
84
+
85
+ const exportJob = await client.exports.run({ gameId: game.id, datasetKey: 'cards' })
86
+ await client.exports.waitForJob(exportJob.id)
87
+ ```
88
+
89
+ See the main README for direct payload, uploaded file, source URL, advanced schema-creating import, bulk delete preview/execution, export URL refresh, and release-prep examples. See `publisher-content-pipeline.example.ts` for a CI/CD-style content sync script.
90
+
62
91
  ## MemoryCache
63
92
 
64
93
  Simple in-memory cache with TTL support:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carddb/node",
3
- "version": "0.2.0",
3
+ "version": "0.2.5",
4
4
  "description": "CardDB client for Node.js, Bun, and Deno",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -50,8 +50,8 @@
50
50
  "url": "https://github.com/carddb/carddb-js/issues"
51
51
  },
52
52
  "dependencies": {
53
- "@carddb/client": "0.2.0",
54
- "@carddb/core": "0.2.0"
53
+ "@carddb/client": "0.2.5",
54
+ "@carddb/core": "0.2.5"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=18.0.0"