@spawnco/sdk-types 0.0.47 → 0.0.48
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/index.d.mts +24 -0
- package/dist/index.d.ts +24 -0
- package/package.json +1 -1
- package/src/v1.ts +28 -0
package/dist/index.d.mts
CHANGED
|
@@ -213,6 +213,30 @@ interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
213
213
|
price: number;
|
|
214
214
|
}): Promise<boolean>;
|
|
215
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Variant-scoped document storage.
|
|
218
|
+
* Documents persist across server restarts and copy when variants fork.
|
|
219
|
+
*/
|
|
220
|
+
documents: {
|
|
221
|
+
/**
|
|
222
|
+
* Read a document by name. Returns null if not found.
|
|
223
|
+
* Documents are scoped to the current variant.
|
|
224
|
+
*/
|
|
225
|
+
get<T = unknown>(name: string): Promise<T | null>;
|
|
226
|
+
/**
|
|
227
|
+
* Write a document. Creates if not exists, replaces if exists.
|
|
228
|
+
* Value must be JSON-serializable.
|
|
229
|
+
*/
|
|
230
|
+
set<T = unknown>(name: string, value: T): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Delete a document by name.
|
|
233
|
+
*/
|
|
234
|
+
delete(name: string): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* List all document names for this variant.
|
|
237
|
+
*/
|
|
238
|
+
list(): Promise<string[]>;
|
|
239
|
+
};
|
|
216
240
|
config: {
|
|
217
241
|
get(): Promise<TConfig>;
|
|
218
242
|
version(): Promise<string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -213,6 +213,30 @@ interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
213
213
|
price: number;
|
|
214
214
|
}): Promise<boolean>;
|
|
215
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Variant-scoped document storage.
|
|
218
|
+
* Documents persist across server restarts and copy when variants fork.
|
|
219
|
+
*/
|
|
220
|
+
documents: {
|
|
221
|
+
/**
|
|
222
|
+
* Read a document by name. Returns null if not found.
|
|
223
|
+
* Documents are scoped to the current variant.
|
|
224
|
+
*/
|
|
225
|
+
get<T = unknown>(name: string): Promise<T | null>;
|
|
226
|
+
/**
|
|
227
|
+
* Write a document. Creates if not exists, replaces if exists.
|
|
228
|
+
* Value must be JSON-serializable.
|
|
229
|
+
*/
|
|
230
|
+
set<T = unknown>(name: string, value: T): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Delete a document by name.
|
|
233
|
+
*/
|
|
234
|
+
delete(name: string): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* List all document names for this variant.
|
|
237
|
+
*/
|
|
238
|
+
list(): Promise<string[]>;
|
|
239
|
+
};
|
|
216
240
|
config: {
|
|
217
241
|
get(): Promise<TConfig>;
|
|
218
242
|
version(): Promise<string>;
|
package/package.json
CHANGED
package/src/v1.ts
CHANGED
|
@@ -234,6 +234,34 @@ export interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
234
234
|
verifyPurchase({ purchaseId, price }: { purchaseId: string; price: number }): Promise<boolean>;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Variant-scoped document storage.
|
|
239
|
+
* Documents persist across server restarts and copy when variants fork.
|
|
240
|
+
*/
|
|
241
|
+
documents: {
|
|
242
|
+
/**
|
|
243
|
+
* Read a document by name. Returns null if not found.
|
|
244
|
+
* Documents are scoped to the current variant.
|
|
245
|
+
*/
|
|
246
|
+
get<T = unknown>(name: string): Promise<T | null>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Write a document. Creates if not exists, replaces if exists.
|
|
250
|
+
* Value must be JSON-serializable.
|
|
251
|
+
*/
|
|
252
|
+
set<T = unknown>(name: string, value: T): Promise<void>;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Delete a document by name.
|
|
256
|
+
*/
|
|
257
|
+
delete(name: string): Promise<void>;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* List all document names for this variant.
|
|
261
|
+
*/
|
|
262
|
+
list(): Promise<string[]>;
|
|
263
|
+
};
|
|
264
|
+
|
|
237
265
|
config: {
|
|
238
266
|
get(): Promise<TConfig>;
|
|
239
267
|
version(): Promise<string>;
|