@seedprotocol/sdk 0.7.5 → 0.7.6-next.957.g6bb7768
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 +2 -2
- package/dist/{ClientManager-DRf4uuei.js → ClientManager-D6YA20jP.js} +207 -149
- package/dist/ClientManager-D6YA20jP.js.map +1 -0
- package/dist/{Item-DTJPMjFk.js → Item-B1MH0tXx.js} +126 -86
- package/dist/Item-B1MH0tXx.js.map +1 -0
- package/dist/{ModelProperty-Dto5C0om.js → ModelProperty-Dw6dHdu_.js} +37 -37
- package/dist/{ModelProperty-Dto5C0om.js.map → ModelProperty-Dw6dHdu_.js.map} +1 -1
- package/dist/{Schema-8DxGcORY.js → Schema-DppObO6h.js} +62 -212
- package/dist/Schema-DppObO6h.js.map +1 -0
- package/dist/{SchemaValidationService-CE92y1TT.js → SchemaValidationService-DXQ-D531.js} +6 -6
- package/dist/{SchemaValidationService-CE92y1TT.js.map → SchemaValidationService-DXQ-D531.js.map} +1 -1
- package/dist/{backfillMetadataPropertyIds-CRqp-BqX.js → backfillMetadataPropertyIds-Uhzlwg9X.js} +3 -3
- package/dist/{backfillMetadataPropertyIds-CRqp-BqX.js.map → backfillMetadataPropertyIds-Uhzlwg9X.js.map} +1 -1
- package/dist/configurePlatform-CVoh3JeR.js +81 -0
- package/dist/configurePlatform-CVoh3JeR.js.map +1 -0
- package/dist/{detachRowsBeforeDelete-BVetHtn2.js → detachRowsBeforeDelete-CtmIFpgV.js} +2 -2
- package/dist/{detachRowsBeforeDelete-BVetHtn2.js.map → detachRowsBeforeDelete-CtmIFpgV.js.map} +1 -1
- package/dist/{discardNewDraft-CEOouygG.js → discardNewDraft-oGYdB5vS.js} +5 -5
- package/dist/{discardNewDraft-CEOouygG.js.map → discardNewDraft-oGYdB5vS.js.map} +1 -1
- package/dist/dist/ClientManager-D6YA20jP.d.ts +933 -0
- package/dist/dist/ClientManager-D6YA20jP.d.ts.map +1 -0
- package/dist/dist/Item-B1MH0tXx.d.ts +898 -0
- package/dist/dist/Item-B1MH0tXx.d.ts.map +1 -0
- package/dist/dist/ModelProperty-Dw6dHdu_.d.ts +315 -0
- package/dist/dist/ModelProperty-Dw6dHdu_.d.ts.map +1 -0
- package/dist/dist/Schema-DppObO6h.d.ts +601 -0
- package/dist/dist/Schema-DppObO6h.d.ts.map +1 -0
- package/dist/dist/SchemaValidationService-DXQ-D531.d.ts +118 -0
- package/dist/dist/SchemaValidationService-DXQ-D531.d.ts.map +1 -0
- package/dist/dist/backfillMetadataPropertyIds-Uhzlwg9X.d.ts +7 -0
- package/dist/dist/backfillMetadataPropertyIds-Uhzlwg9X.d.ts.map +1 -0
- package/dist/dist/configurePlatform-CVoh3JeR.d.ts +30 -0
- package/dist/dist/configurePlatform-CVoh3JeR.d.ts.map +1 -0
- package/dist/dist/detachRowsBeforeDelete-CtmIFpgV.d.ts +13 -0
- package/dist/dist/detachRowsBeforeDelete-CtmIFpgV.d.ts.map +1 -0
- package/dist/dist/discardNewDraft-oGYdB5vS.d.ts +8 -0
- package/dist/dist/discardNewDraft-oGYdB5vS.d.ts.map +1 -0
- package/dist/dist/eas-CSm5wmry.d.ts +12 -0
- package/dist/dist/eas-CSm5wmry.d.ts.map +1 -0
- package/dist/dist/errors-3tc6XkCB.d.ts +487 -0
- package/dist/dist/errors-3tc6XkCB.d.ts.map +1 -0
- package/dist/dist/errors-Do7v6RKu.d.ts +22 -0
- package/dist/dist/errors-Do7v6RKu.d.ts.map +1 -0
- package/dist/dist/getItem-DM3a-7XE.d.ts +6 -0
- package/dist/dist/getItem-DM3a-7XE.d.ts.map +1 -0
- package/dist/dist/getPublishPayload-CJF0k5d8.d.ts +47 -0
- package/dist/dist/getPublishPayload-CJF0k5d8.d.ts.map +1 -0
- package/dist/dist/getPublishUploads-C7-fYIgX.d.ts +89 -0
- package/dist/dist/getPublishUploads-C7-fYIgX.d.ts.map +1 -0
- package/dist/dist/index--mmQ3LQu.d.ts +6 -0
- package/dist/dist/index--mmQ3LQu.d.ts.map +1 -0
- package/dist/dist/index-B7yAoYli.d.ts +2752 -0
- package/dist/dist/index-B7yAoYli.d.ts.map +1 -0
- package/dist/dist/index-CrvIcVFJ.d.ts +4475 -0
- package/dist/dist/index-CrvIcVFJ.d.ts.map +1 -0
- package/dist/dist/index.browser-BmVS-c2C.d.ts +8445 -0
- package/dist/dist/index.browser-BmVS-c2C.d.ts.map +1 -0
- package/dist/dist/index.node-BKpbCAWt.d.ts +11123 -0
- package/dist/dist/index.node-BKpbCAWt.d.ts.map +1 -0
- package/dist/dist/mimeTypes-C9r76DCH.d.ts +30 -0
- package/dist/dist/mimeTypes-C9r76DCH.d.ts.map +1 -0
- package/dist/dist/model-oHA3YhOd.d.ts +6 -0
- package/dist/dist/model-oHA3YhOd.d.ts.map +1 -0
- package/dist/dist/platform.browser.d.ts +3 -0
- package/dist/dist/platform.browser.d.ts.map +1 -0
- package/dist/dist/platform.node.d.ts +3 -0
- package/dist/dist/platform.node.d.ts.map +1 -0
- package/dist/dist/property-DQ-Owzki.d.ts +37 -0
- package/dist/dist/property-DQ-Owzki.d.ts.map +1 -0
- package/dist/dist/propertyValidationRules-BDhFjlwP.d.ts +8 -0
- package/dist/dist/propertyValidationRules-BDhFjlwP.d.ts.map +1 -0
- package/dist/dist/publishDraftGraph-CzPd9oe9.d.ts +76 -0
- package/dist/dist/publishDraftGraph-CzPd9oe9.d.ts.map +1 -0
- package/dist/dist/resetAmbiguousLegacyItemData-cXZm4NuG.d.ts +17 -0
- package/dist/dist/resetAmbiguousLegacyItemData-cXZm4NuG.d.ts.map +1 -0
- package/dist/dist/resolveModelForSyncedSeed-BgxtVCHI.d.ts +21 -0
- package/dist/dist/resolveModelForSyncedSeed-BgxtVCHI.d.ts.map +1 -0
- package/dist/dist/syncDbWithEas-Y5GysSCm.d.ts +22 -0
- package/dist/dist/syncDbWithEas-Y5GysSCm.d.ts.map +1 -0
- package/dist/dist/tabEvents-D9x26vf2.d.ts +81 -0
- package/dist/dist/tabEvents-D9x26vf2.d.ts.map +1 -0
- package/dist/dist/tolerantWebAccess-BFU2t-SC.d.ts +113 -0
- package/dist/dist/tolerantWebAccess-BFU2t-SC.d.ts.map +1 -0
- package/dist/dist/updateSeedRevokedAt-CCF8WWYS.d.ts +11 -0
- package/dist/dist/updateSeedRevokedAt-CCF8WWYS.d.ts.map +1 -0
- package/dist/drizzle.js +2 -0
- package/dist/drizzle.js.map +1 -0
- package/dist/{eas-D7jvWMnI.js → eas-CSm5wmry.js} +3 -3
- package/dist/{eas-D7jvWMnI.js.map → eas-CSm5wmry.js.map} +1 -1
- package/dist/{errors-CIrbsN_i.js → errors-3tc6XkCB.js} +81 -36
- package/dist/errors-3tc6XkCB.js.map +1 -0
- package/dist/errors-Do7v6RKu.js +34 -0
- package/dist/errors-Do7v6RKu.js.map +1 -0
- package/dist/{getItem-CxU_kT5W.js → getItem-DM3a-7XE.js} +4 -4
- package/dist/{getItem-CxU_kT5W.js.map → getItem-DM3a-7XE.js.map} +1 -1
- package/dist/{getPublishPayload-DTjOKd3y.js → getPublishPayload-CJF0k5d8.js} +31 -25
- package/dist/getPublishPayload-CJF0k5d8.js.map +1 -0
- package/dist/{getPublishUploads-CVTBo_OV.js → getPublishUploads-C7-fYIgX.js} +6 -6
- package/dist/{getPublishUploads-CVTBo_OV.js.map → getPublishUploads-C7-fYIgX.js.map} +1 -1
- package/dist/{index-CMxEil8T.js → index--mmQ3LQu.js} +8 -8
- package/dist/index--mmQ3LQu.js.map +1 -0
- package/dist/{index-DWK-LOUY.js → index-B7yAoYli.js} +2 -2
- package/dist/index-B7yAoYli.js.map +1 -0
- package/dist/{BasePathResolver-CBTXCMFL.js → index-CrvIcVFJ.js} +304 -285
- package/dist/index-CrvIcVFJ.js.map +1 -0
- package/dist/{index.browser-shRXMeB3.js → index.browser-BmVS-c2C.js} +34 -44
- package/dist/index.browser-BmVS-c2C.js.map +1 -0
- package/dist/{index.node-DAKJNYp5.js → index.node-BKpbCAWt.js} +43 -7
- package/dist/index.node-BKpbCAWt.js.map +1 -0
- package/dist/main.js +23 -24
- package/dist/main.js.map +1 -1
- package/dist/node.js +13 -10
- package/dist/node.js.map +1 -1
- package/dist/platform.browser.js +7 -7
- package/dist/platform.node.js +4 -4
- package/dist/{property-lz9yIpyA.js → property-DQ-Owzki.js} +7 -7
- package/dist/{property-lz9yIpyA.js.map → property-DQ-Owzki.js.map} +1 -1
- package/dist/{propertyValidationRules-LuIwoQoJ.js → propertyValidationRules-BDhFjlwP.js} +10 -10
- package/dist/{propertyValidationRules-LuIwoQoJ.js.map → propertyValidationRules-BDhFjlwP.js.map} +1 -1
- package/dist/{publishDraftGraph-CgSLPKvQ.js → publishDraftGraph-CzPd9oe9.js} +41 -8
- package/dist/publishDraftGraph-CzPd9oe9.js.map +1 -0
- package/dist/{resetAmbiguousLegacyItemData-CuamkAAh.js → resetAmbiguousLegacyItemData-cXZm4NuG.js} +2 -2
- package/dist/{resetAmbiguousLegacyItemData-CuamkAAh.js.map → resetAmbiguousLegacyItemData-cXZm4NuG.js.map} +1 -1
- package/dist/{resolveModelForSyncedSeed-BbSctSvz.js → resolveModelForSyncedSeed-BgxtVCHI.js} +2 -2
- package/dist/{resolveModelForSyncedSeed-BbSctSvz.js.map → resolveModelForSyncedSeed-BgxtVCHI.js.map} +1 -1
- package/dist/src/Item/Item.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/initialize.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/rowContext.d.ts +10 -0
- package/dist/src/ItemProperty/service/actors/saveValueToDb/rowContext.d.ts.map +1 -0
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveFile.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveHtml.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveImage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/actors/saveValueToDb/saveItemStorage.d.ts.map +1 -1
- package/dist/src/ItemProperty/service/propertyMachine.d.ts +20 -20
- package/dist/src/Model/Model.d.ts +8 -0
- package/dist/src/Model/Model.d.ts.map +1 -1
- package/dist/src/ModelProperty/ModelProperty.d.ts +1 -1
- package/dist/src/ModelProperty/service/modelPropertyMachine.d.ts +3 -3
- package/dist/src/Schema/service/actors/checkExistingSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
- package/dist/src/Schema/service/actors/writeModelsToDb.d.ts.map +1 -1
- package/dist/src/browser/db/Db.d.ts.map +1 -1
- package/dist/src/browser/helpers/ArweaveClient.d.ts.map +1 -1
- package/dist/src/client/actors/addModelsToDb.d.ts.map +1 -1
- package/dist/src/client/actors/platformClassesInit.d.ts +1 -7
- package/dist/src/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/src/client/actors/saveAppState.d.ts.map +1 -1
- package/dist/src/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/src/client/seedConfigDefaults.d.ts +10 -0
- package/dist/src/client/seedConfigDefaults.d.ts.map +1 -0
- package/dist/src/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/src/db/write/updateItemPropertyValue.d.ts +6 -0
- package/dist/src/db/write/updateItemPropertyValue.d.ts.map +1 -1
- package/dist/src/drizzle/index.d.ts +7 -0
- package/dist/src/drizzle/index.d.ts.map +1 -0
- package/dist/src/events/files/download.d.ts.map +1 -1
- package/dist/src/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/src/helpers/FileManager/errors.d.ts +11 -0
- package/dist/src/helpers/FileManager/errors.d.ts.map +1 -1
- package/dist/src/helpers/db.d.ts +14 -0
- package/dist/src/helpers/db.d.ts.map +1 -1
- package/dist/src/helpers/dotSeedPath.d.ts +7 -0
- package/dist/src/helpers/dotSeedPath.d.ts.map +1 -0
- package/dist/src/helpers/entity/entityLiveQuery.d.ts.map +1 -1
- package/dist/src/helpers/environment.d.ts +5 -0
- package/dist/src/helpers/environment.d.ts.map +1 -1
- package/dist/src/helpers/getSegmentedItemProperties.d.ts.map +1 -1
- package/dist/src/helpers/metadataPropertyNames.d.ts +10 -0
- package/dist/src/helpers/metadataPropertyNames.d.ts.map +1 -1
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts +9 -0
- package/dist/src/helpers/reconcilePropertyDraftRows.d.ts.map +1 -0
- package/dist/src/helpers/updateSchema.d.ts.map +1 -1
- package/dist/src/imports/index.d.ts +1 -1
- package/dist/src/imports/index.d.ts.map +1 -1
- package/dist/src/imports/json.d.ts +18 -5
- package/dist/src/imports/json.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/node/helpers/resolveFilesDir.d.ts +8 -0
- package/dist/src/node/helpers/resolveFilesDir.d.ts.map +1 -0
- package/dist/src/node/webpack/index.d.ts +2 -0
- package/dist/src/node/webpack/index.d.ts.map +1 -1
- package/dist/src/platform/index.browser.d.ts +5 -0
- package/dist/src/platform/index.browser.d.ts.map +1 -1
- package/dist/src/platform/index.node.d.ts +1 -0
- package/dist/src/platform/index.node.d.ts.map +1 -1
- package/dist/src/stores/eas.d.ts +1 -1
- package/dist/src/stores/eas.d.ts.map +1 -1
- package/dist/src/types/import.d.ts +15 -0
- package/dist/src/types/import.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +8 -4
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/{syncDbWithEas-CrAY9Rl2.js → syncDbWithEas-Y5GysSCm.js} +17 -13
- package/dist/syncDbWithEas-Y5GysSCm.js.map +1 -0
- package/dist/{tabEvents-BGBYV65P.js → tabEvents-D9x26vf2.js} +4 -4
- package/dist/{tabEvents-BGBYV65P.js.map → tabEvents-D9x26vf2.js.map} +1 -1
- package/dist/{tolerantWebAccess-DVHCEulL.js → tolerantWebAccess-BFU2t-SC.js} +8 -8
- package/dist/{tolerantWebAccess-DVHCEulL.js.map → tolerantWebAccess-BFU2t-SC.js.map} +1 -1
- package/dist/{updateSeedRevokedAt-Dy5J8CfQ.js → updateSeedRevokedAt-CCF8WWYS.js} +3 -3
- package/dist/{updateSeedRevokedAt-Dy5J8CfQ.js.map → updateSeedRevokedAt-CCF8WWYS.js.map} +1 -1
- package/package.json +31 -31
- package/dist/BasePathResolver-CBTXCMFL.js.map +0 -1
- package/dist/ClientManager-DRf4uuei.js.map +0 -1
- package/dist/Item-DTJPMjFk.js.map +0 -1
- package/dist/Schema-8DxGcORY.js.map +0 -1
- package/dist/configurePlatform-D4aGjKNk.js +0 -31
- package/dist/configurePlatform-D4aGjKNk.js.map +0 -1
- package/dist/errors-CIrbsN_i.js.map +0 -1
- package/dist/errors-CrBxGWah.js +0 -17
- package/dist/errors-CrBxGWah.js.map +0 -1
- package/dist/getPublishPayload-DTjOKd3y.js.map +0 -1
- package/dist/index-CMxEil8T.js.map +0 -1
- package/dist/index-DWK-LOUY.js.map +0 -1
- package/dist/index.browser-shRXMeB3.js.map +0 -1
- package/dist/index.node-DAKJNYp5.js.map +0 -1
- package/dist/publishDraftGraph-CgSLPKvQ.js.map +0 -1
- package/dist/src/client/nodeEndpointDefaults.d.ts +0 -8
- package/dist/src/client/nodeEndpointDefaults.d.ts.map +0 -1
- package/dist/syncDbWithEas-CrAY9Rl2.js.map +0 -1
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when a conflict is detected between actor context and database
|
|
3
|
+
*/
|
|
4
|
+
declare class ConflictError extends Error {
|
|
5
|
+
constructor(message: any, conflict: any);
|
|
6
|
+
conflict: any;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Thrown by Item.create when values don't fit the model: unknown keys, wrong types, or values
|
|
10
|
+
* that break the property's validation rules. Nothing is left written: most values are checked
|
|
11
|
+
* before anything is written, and File/Image/Html/ItemStorage values, checked as they're saved,
|
|
12
|
+
* have their draft removed.
|
|
13
|
+
*/
|
|
14
|
+
declare class ItemCreateValidationError extends Error {
|
|
15
|
+
constructor(modelName: any, problems: any);
|
|
16
|
+
modelName: any;
|
|
17
|
+
problems: any;
|
|
18
|
+
}
|
|
19
|
+
declare class Model {
|
|
20
|
+
static trackPendingWrite(modelFileId: any, schemaId: any): void;
|
|
21
|
+
static getPendingModelIds(schemaId: any): any[];
|
|
22
|
+
/**
|
|
23
|
+
* Resolves once the model is idle and any properties passed to Model.create exist.
|
|
24
|
+
* Rejects if it errors, times out, or its properties can't be created.
|
|
25
|
+
*/
|
|
26
|
+
static waitUntilReady(instance: any, timeout: any): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Gives an idle, valid model the row someone else wrote for its id, the way its own write would
|
|
29
|
+
* (writeSuccess with the row's id, which goes on to create its properties from their rows).
|
|
30
|
+
* Returns false when there is no such row, so the model writes it.
|
|
31
|
+
*/
|
|
32
|
+
static adoptPersistedRow(instance: any): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* True when a name-cached instance belongs to a different model than the requested modelFileId.
|
|
35
|
+
* A schema re-imported under the same name can give its models new ids while the previous
|
|
36
|
+
* instances are still cached by name; Model.create must not hand those back for the new id.
|
|
37
|
+
*/
|
|
38
|
+
static isOtherModelId(cachedId: any, requestedId: any): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Find a unique model name by checking for duplicates (case-insensitive) in the cache
|
|
41
|
+
* If duplicates are found, appends an incrementing number to make it unique
|
|
42
|
+
*
|
|
43
|
+
* @param modelName - The desired model name
|
|
44
|
+
* @param schemaName - The schema name
|
|
45
|
+
* @param skipAllChecks - If true, skip all duplicate checks and return original name (used when creating schema models to preserve original names)
|
|
46
|
+
* @returns A unique model name
|
|
47
|
+
*/
|
|
48
|
+
static findUniqueModelName(modelName: any, schemaName: any, skipAllChecks?: boolean): any;
|
|
49
|
+
static create(modelName: any, schemaNameOrSchema: any, options: any): any;
|
|
50
|
+
/**
|
|
51
|
+
* Get Model instance by modelFileId (O(1) lookup)
|
|
52
|
+
*/
|
|
53
|
+
static getById(modelFileId: any): any;
|
|
54
|
+
/**
|
|
55
|
+
* Get Model instance by name (O(1) lookup via name→ID mapping)
|
|
56
|
+
*
|
|
57
|
+
* @param modelName - The name of the model
|
|
58
|
+
* @param schemaName - The schema name (optional, will query DB if not provided)
|
|
59
|
+
* @returns The Model instance if found, undefined otherwise
|
|
60
|
+
*/
|
|
61
|
+
static getByName(modelName: any, schemaName: any): any;
|
|
62
|
+
/** The one cached Model whose name matches, or AmbiguousModelError if models from several schemas do. */
|
|
63
|
+
static _getUniqueCachedModel(label: any, matches: any): any;
|
|
64
|
+
/**
|
|
65
|
+
* Resolve a cached Model from the most specific scope available: modelFileId (Model.id), then
|
|
66
|
+
* schemaName + modelName, then modelName alone.
|
|
67
|
+
*/
|
|
68
|
+
static resolve(modelName: any, scope?: {}): any;
|
|
69
|
+
/**
|
|
70
|
+
* Find Model by modelType (an EAS model name, as seeds.type stores it). Matched as ADR 0008
|
|
71
|
+
* matches EAS names: `new_model` finds "New model", and `htmlpage` (an older SDK's name) finds
|
|
72
|
+
* "HTMLPage", unless HTMLPage's nameMatch (ADR 0009) is `exact`. Only the tightest matching tier
|
|
73
|
+
* counts; matches in several schemas are ambiguous.
|
|
74
|
+
*/
|
|
75
|
+
static findByModelType(modelType: any): any;
|
|
76
|
+
/**
|
|
77
|
+
* Get all Model instances for a schema from cache only (synchronous).
|
|
78
|
+
* Includes models created at runtime via Model.create() that may not yet be in schema context.
|
|
79
|
+
*/
|
|
80
|
+
static getCachedInstancesForSchema(schemaName: any): any[];
|
|
81
|
+
/**
|
|
82
|
+
* Async Model.resolve(): exact cache hit by modelFileId or schemaName+modelName, else the DB row for
|
|
83
|
+
* that scope (instantiating the Model), and only then the name-only fallback.
|
|
84
|
+
*/
|
|
85
|
+
static resolveAsync(modelName: any, scope?: {}): Promise<any>;
|
|
86
|
+
/**
|
|
87
|
+
* Get Model instance by name, querying database if not in cache
|
|
88
|
+
* This is an async version that can query the database when schemaName is not provided
|
|
89
|
+
*
|
|
90
|
+
* @param modelName - The name of the model
|
|
91
|
+
* @param schemaName - Optional schema name (will query DB if not provided)
|
|
92
|
+
* @returns The Model instance if found, undefined otherwise
|
|
93
|
+
*/
|
|
94
|
+
static getByNameAsync(modelName: any, schemaName: any, options: any): Promise<any>;
|
|
95
|
+
/**
|
|
96
|
+
* Create or get Model instance by modelFileId
|
|
97
|
+
* Checks cache first, then database if not found
|
|
98
|
+
*
|
|
99
|
+
* @param modelFileId - The model file ID to look up
|
|
100
|
+
* @returns The Model instance if found, undefined otherwise
|
|
101
|
+
*/
|
|
102
|
+
static createById(modelFileId: any, options: any): Promise<any>;
|
|
103
|
+
/**
|
|
104
|
+
* Find Model instance by modelFileId, modelName/schemaName, or both
|
|
105
|
+
* Waits for the model to be fully loaded (idle state) by default
|
|
106
|
+
* @param options - Find options including lookup parameters and wait configuration
|
|
107
|
+
* @returns Model instance if found, undefined otherwise
|
|
108
|
+
*/
|
|
109
|
+
static find({ modelFileId, modelName, schemaName, waitForReady, readyTimeout, }: {
|
|
110
|
+
modelFileId: any;
|
|
111
|
+
modelName: any;
|
|
112
|
+
schemaName: any;
|
|
113
|
+
waitForReady?: boolean | undefined;
|
|
114
|
+
readyTimeout?: number | undefined;
|
|
115
|
+
}): Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* Get all Model instances for a schema by schemaFileId or schemaName
|
|
118
|
+
* Queries database for all models with the given schemaId/schemaName and returns Model instances
|
|
119
|
+
*
|
|
120
|
+
* @param schemaIdentifier - The schema file ID or schema name to get models for
|
|
121
|
+
* @returns Array of Model instances for the schema
|
|
122
|
+
*/
|
|
123
|
+
static createBySchemaId(schemaIdentifier: any): Promise<any[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Get all Model instances, optionally filtered by schema.
|
|
126
|
+
* When DB is available, loads from DB via getModelsData; otherwise returns from cache.
|
|
127
|
+
* With waitForReady, waits for each model to be ready (idle, with any properties from Model.create
|
|
128
|
+
* created) and leaves out models that error or time out.
|
|
129
|
+
*/
|
|
130
|
+
static all(schemaName: any, options: any): Promise<any[]>;
|
|
131
|
+
/**
|
|
132
|
+
* Update name index when model name changes
|
|
133
|
+
*/
|
|
134
|
+
static updateNameIndex(oldName: any, newName: any, schemaName: any, modelFileId: any): void;
|
|
135
|
+
/**
|
|
136
|
+
* Force-evict every cached Model belonging to a schema, ignoring refCounts, and stop their services.
|
|
137
|
+
* Used by Schema.destroy(): once the DB rows are gone, cached instances would keep a dangling _dbId
|
|
138
|
+
* and be handed back by Model.create/Model.all after the schema is re-imported.
|
|
139
|
+
* @returns names of the evicted models (so callers can evict their ModelProperty instances)
|
|
140
|
+
*/
|
|
141
|
+
static evictForSchema(schemaName: any): any[];
|
|
142
|
+
/**
|
|
143
|
+
* Refresh the property ids of every cached Model whose DB row is `dbId`. Called when a property
|
|
144
|
+
* write for that model finishes: until then `properties` includes it as a pending write, and in Node
|
|
145
|
+
* (no reactive liveQuery) nothing else adds it to `_liveQueryPropertyIds`.
|
|
146
|
+
*/
|
|
147
|
+
static refreshPropertiesForDbId(dbId: any): Promise<void>;
|
|
148
|
+
constructor(modelName: any, schemaName: any, id: any, initialContext: any, idFromSchema: any);
|
|
149
|
+
_service: import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
150
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
151
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
src: "validateEntity";
|
|
154
|
+
logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
155
|
+
id: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
src: "writeToDatabase";
|
|
158
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
159
|
+
id: string | undefined;
|
|
160
|
+
}, never, never, never, "error" | "idle" | "validating" | "writing" | "success", string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
161
|
+
id: "writeProcess";
|
|
162
|
+
states: {
|
|
163
|
+
readonly idle: {};
|
|
164
|
+
readonly validating: {};
|
|
165
|
+
readonly writing: {};
|
|
166
|
+
readonly success: {};
|
|
167
|
+
readonly error: {};
|
|
168
|
+
};
|
|
169
|
+
}, import("xstate").MetaObject>> | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
src: "loadOrCreateModel";
|
|
172
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
173
|
+
id: string | undefined;
|
|
174
|
+
} | {
|
|
175
|
+
src: "validateModel";
|
|
176
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
177
|
+
id: string | undefined;
|
|
178
|
+
} | {
|
|
179
|
+
src: "createModelProperties";
|
|
180
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
181
|
+
id: string | undefined;
|
|
182
|
+
} | {
|
|
183
|
+
src: "writeProcessMachine";
|
|
184
|
+
logic: import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
185
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
src: "validateEntity";
|
|
188
|
+
logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
189
|
+
id: string | undefined;
|
|
190
|
+
} | {
|
|
191
|
+
src: "writeToDatabase";
|
|
192
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
193
|
+
id: string | undefined;
|
|
194
|
+
}, never, never, never, "error" | "idle" | "validating" | "writing" | "success", string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
195
|
+
id: "writeProcess";
|
|
196
|
+
states: {
|
|
197
|
+
readonly idle: {};
|
|
198
|
+
readonly validating: {};
|
|
199
|
+
readonly writing: {};
|
|
200
|
+
readonly success: {};
|
|
201
|
+
readonly error: {};
|
|
202
|
+
};
|
|
203
|
+
}, import("xstate").MetaObject>;
|
|
204
|
+
id: string | undefined;
|
|
205
|
+
}, never, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
206
|
+
id?: string | undefined | undefined;
|
|
207
|
+
states?: {} | undefined;
|
|
208
|
+
}, import("xstate").MetaObject>>;
|
|
209
|
+
getService(): import("xstate").Actor<import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
210
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
211
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
src: "validateEntity";
|
|
214
|
+
logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
215
|
+
id: string | undefined;
|
|
216
|
+
} | {
|
|
217
|
+
src: "writeToDatabase";
|
|
218
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
219
|
+
id: string | undefined;
|
|
220
|
+
}, never, never, never, "error" | "idle" | "validating" | "writing" | "success", string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
221
|
+
id: "writeProcess";
|
|
222
|
+
states: {
|
|
223
|
+
readonly idle: {};
|
|
224
|
+
readonly validating: {};
|
|
225
|
+
readonly writing: {};
|
|
226
|
+
readonly success: {};
|
|
227
|
+
readonly error: {};
|
|
228
|
+
};
|
|
229
|
+
}, import("xstate").MetaObject>> | undefined;
|
|
230
|
+
}, {
|
|
231
|
+
src: "loadOrCreateModel";
|
|
232
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
233
|
+
id: string | undefined;
|
|
234
|
+
} | {
|
|
235
|
+
src: "validateModel";
|
|
236
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
237
|
+
id: string | undefined;
|
|
238
|
+
} | {
|
|
239
|
+
src: "createModelProperties";
|
|
240
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
241
|
+
id: string | undefined;
|
|
242
|
+
} | {
|
|
243
|
+
src: "writeProcessMachine";
|
|
244
|
+
logic: import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
245
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
246
|
+
}, {
|
|
247
|
+
src: "validateEntity";
|
|
248
|
+
logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
249
|
+
id: string | undefined;
|
|
250
|
+
} | {
|
|
251
|
+
src: "writeToDatabase";
|
|
252
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
253
|
+
id: string | undefined;
|
|
254
|
+
}, never, never, never, "error" | "idle" | "validating" | "writing" | "success", string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
255
|
+
id: "writeProcess";
|
|
256
|
+
states: {
|
|
257
|
+
readonly idle: {};
|
|
258
|
+
readonly validating: {};
|
|
259
|
+
readonly writing: {};
|
|
260
|
+
readonly success: {};
|
|
261
|
+
readonly error: {};
|
|
262
|
+
};
|
|
263
|
+
}, import("xstate").MetaObject>;
|
|
264
|
+
id: string | undefined;
|
|
265
|
+
}, never, never, never, {}, string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
266
|
+
id?: string | undefined | undefined;
|
|
267
|
+
states?: {} | undefined;
|
|
268
|
+
}, import("xstate").MetaObject>>;
|
|
269
|
+
_getSnapshot(): import("xstate").MachineSnapshot<{}, import("xstate").AnyEventObject, {
|
|
270
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
271
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
src: "validateEntity";
|
|
274
|
+
logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
275
|
+
id: string | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
src: "writeToDatabase";
|
|
278
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
279
|
+
id: string | undefined;
|
|
280
|
+
}, never, never, never, "error" | "idle" | "validating" | "writing" | "success", string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
281
|
+
id: "writeProcess";
|
|
282
|
+
states: {
|
|
283
|
+
readonly idle: {};
|
|
284
|
+
readonly validating: {};
|
|
285
|
+
readonly writing: {};
|
|
286
|
+
readonly success: {};
|
|
287
|
+
readonly error: {};
|
|
288
|
+
};
|
|
289
|
+
}, import("xstate").MetaObject>> | undefined;
|
|
290
|
+
}, {}, string, import("xstate").NonReducibleUnknown, import("xstate").MetaObject, {
|
|
291
|
+
id?: string | undefined | undefined;
|
|
292
|
+
states?: {} | undefined;
|
|
293
|
+
}>;
|
|
294
|
+
_getSnapshotContext(): {};
|
|
295
|
+
/**
|
|
296
|
+
* Check for conflicts between actor context and database
|
|
297
|
+
* @returns ConflictResult indicating if a conflict exists
|
|
298
|
+
*/
|
|
299
|
+
_checkForConflicts(): Promise<{
|
|
300
|
+
hasConflict: boolean;
|
|
301
|
+
}>;
|
|
302
|
+
/**
|
|
303
|
+
* Saves model name changes to the database immediately (draft save)
|
|
304
|
+
* This is called when modelName is changed to persist the change immediately
|
|
305
|
+
* @param oldName - The old model name (if name changed)
|
|
306
|
+
* @param newName - The new model name
|
|
307
|
+
*/
|
|
308
|
+
_saveDraftToDb(oldName: any, newName: any): Promise<void>;
|
|
309
|
+
get status(): {};
|
|
310
|
+
/** The error from the last draft save a rename started, or undefined once a later one succeeds. */
|
|
311
|
+
get lastSaveError(): any;
|
|
312
|
+
get validationErrors(): any;
|
|
313
|
+
get isValid(): boolean;
|
|
314
|
+
get isEdited(): any;
|
|
315
|
+
get id(): any;
|
|
316
|
+
get name(): any;
|
|
317
|
+
/**
|
|
318
|
+
* Returns ModelProperty instances for this model
|
|
319
|
+
* This is a computed property that reads from the service context
|
|
320
|
+
* Note: This is NOT reactive - use useModelProperties() hook for reactivity
|
|
321
|
+
*/
|
|
322
|
+
get properties(): any[];
|
|
323
|
+
/**
|
|
324
|
+
* Validate the model
|
|
325
|
+
* @returns Validation result
|
|
326
|
+
*/
|
|
327
|
+
validate(): Promise<any>;
|
|
328
|
+
/**
|
|
329
|
+
* Create a new item instance from this model
|
|
330
|
+
* Automatically injects the model name, so you don't need to pass it explicitly.
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* const Post = Model.create('Post', schema)
|
|
334
|
+
* const post = await Post.create({ title: 'My Post', content: '...' })
|
|
335
|
+
*
|
|
336
|
+
* @param values - Item property values (modelName is automatically injected)
|
|
337
|
+
* @returns The created item instance
|
|
338
|
+
*/
|
|
339
|
+
create(values: any): Promise<any>;
|
|
340
|
+
/**
|
|
341
|
+
* Reload model from database
|
|
342
|
+
* This refreshes the actor context with the latest data from the database
|
|
343
|
+
*/
|
|
344
|
+
reload(): Promise<any>;
|
|
345
|
+
/**
|
|
346
|
+
* Unload the model instance and clean up resources
|
|
347
|
+
*/
|
|
348
|
+
unload(): void;
|
|
349
|
+
/**
|
|
350
|
+
* Destroy the model instance completely: remove from caches, delete from database,
|
|
351
|
+
* update Schema context, stop service. Uses shared destroy helpers.
|
|
352
|
+
*/
|
|
353
|
+
destroy(): Promise<void>;
|
|
354
|
+
/**
|
|
355
|
+
* Set up liveQuery subscription to watch for property changes in the database
|
|
356
|
+
* This enables cross-instance synchronization (e.g., changes in other tabs/windows)
|
|
357
|
+
*/
|
|
358
|
+
_setupLiveQuerySubscription(): void;
|
|
359
|
+
/**
|
|
360
|
+
* Refresh property IDs from database (useful in Node.js where liveQuery isn't available)
|
|
361
|
+
*/
|
|
362
|
+
_refreshPropertiesFromDb(): Promise<void>;
|
|
363
|
+
/**
|
|
364
|
+
* Public method to refresh properties from database
|
|
365
|
+
*/
|
|
366
|
+
refreshProperties(): Promise<void>;
|
|
367
|
+
}
|
|
368
|
+
declare namespace Model {
|
|
369
|
+
let instanceCacheById: Map<any, any>;
|
|
370
|
+
let instanceCacheByName: Map<any, any>;
|
|
371
|
+
let instanceCache: Map<any, any>;
|
|
372
|
+
let pendingWrites: Map<any, any>;
|
|
373
|
+
let savingModels: Set<any>;
|
|
374
|
+
let cachedClientInitialized: any;
|
|
375
|
+
let clientCheckTime: number;
|
|
376
|
+
let CLIENT_CHECK_CACHE_MS: number;
|
|
377
|
+
}
|
|
378
|
+
declare const TModelSchema: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
379
|
+
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
380
|
+
_dbId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
381
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
382
|
+
dataType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"Text">, import("@sinclair/typebox").TLiteral<"Number">, import("@sinclair/typebox").TLiteral<"List">, import("@sinclair/typebox").TLiteral<"Relation">, import("@sinclair/typebox").TLiteral<"Image">, import("@sinclair/typebox").TLiteral<"Json">, import("@sinclair/typebox").TLiteral<"File">, import("@sinclair/typebox").TLiteral<"Boolean">, import("@sinclair/typebox").TLiteral<"Date">, import("@sinclair/typebox").TLiteral<"Html">]>;
|
|
383
|
+
ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
384
|
+
modelId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TString]>>;
|
|
385
|
+
modelName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
386
|
+
refModelId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
387
|
+
refModelName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
388
|
+
refValueType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"Text">, import("@sinclair/typebox").TLiteral<"Number">, import("@sinclair/typebox").TLiteral<"List">, import("@sinclair/typebox").TLiteral<"Relation">, import("@sinclair/typebox").TLiteral<"Image">, import("@sinclair/typebox").TLiteral<"Json">, import("@sinclair/typebox").TLiteral<"File">, import("@sinclair/typebox").TLiteral<"Boolean">, import("@sinclair/typebox").TLiteral<"Date">, import("@sinclair/typebox").TLiteral<"Html">]>>;
|
|
389
|
+
storageType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"ItemStorage">, import("@sinclair/typebox").TLiteral<"PropertyStorage">]>>;
|
|
390
|
+
localStorageDir: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
391
|
+
filenameSuffix: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
392
|
+
validation: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
393
|
+
pattern: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
394
|
+
minLength: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
395
|
+
maxLength: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
396
|
+
enum: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>>;
|
|
397
|
+
custom: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
398
|
+
}>>;
|
|
399
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
400
|
+
htmlEmbeddedDataUriPolicy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"materialize">, import("@sinclair/typebox").TLiteral<"preserve">]>>;
|
|
401
|
+
}>>;
|
|
402
|
+
/** Thrown by Item.create when no model with that name exists (in the given schema, if any). */
|
|
403
|
+
declare class UnknownModelError extends Error {
|
|
404
|
+
constructor(modelName: any, schemaName: any);
|
|
405
|
+
modelName: any;
|
|
406
|
+
schemaName: any;
|
|
407
|
+
}
|
|
408
|
+
declare const TModelValues: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
|
|
409
|
+
/**
|
|
410
|
+
* True when any schema was evicted after `since` or is being destroyed (cheap check before looking up
|
|
411
|
+
* which schemas apply).
|
|
412
|
+
*/
|
|
413
|
+
declare function anyEvictionSince(since: any): boolean;
|
|
414
|
+
declare function currentEvictionEpoch(): number;
|
|
415
|
+
/**
|
|
416
|
+
* Set up liveQuery subscription for an entity
|
|
417
|
+
* This enables cross-instance synchronization (e.g., changes in other tabs/windows)
|
|
418
|
+
*
|
|
419
|
+
* @param instance - Entity instance
|
|
420
|
+
* @param config - LiveQuery configuration
|
|
421
|
+
*/
|
|
422
|
+
declare function setupEntityLiveQuery(instance: any, config: any): void;
|
|
423
|
+
declare var writeToDatabase$1: Readonly<{
|
|
424
|
+
__proto__: null;
|
|
425
|
+
waitForInFlightWrites: (timeoutMs?: number) => Promise<void>;
|
|
426
|
+
writeToDatabase: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
427
|
+
}>;
|
|
428
|
+
declare function finishSchemaDestroy(schemaName: any): void;
|
|
429
|
+
declare function getDraftSaveError(service: any): any;
|
|
430
|
+
declare var Model$1: Readonly<{
|
|
431
|
+
__proto__: null;
|
|
432
|
+
Model: typeof Model;
|
|
433
|
+
}>;
|
|
434
|
+
/**
|
|
435
|
+
* Common getters and utilities for entity classes
|
|
436
|
+
* These work with any entity that has a getService() method returning an XState actor
|
|
437
|
+
*/
|
|
438
|
+
/**
|
|
439
|
+
* Get the current state value from an entity's service
|
|
440
|
+
*/
|
|
441
|
+
/**
|
|
442
|
+
* Whether an actor has been stopped (unload, destroy, or Schema eviction). Async work started by an
|
|
443
|
+
* entity (DB lookups, retry timers) must check this before sending, since a stopped actor ignores
|
|
444
|
+
* events and XState warns about every one of them.
|
|
445
|
+
*/
|
|
446
|
+
declare function isActorStopped(actor: any): boolean;
|
|
447
|
+
declare var errors: Readonly<{
|
|
448
|
+
__proto__: null;
|
|
449
|
+
ItemCreateValidationError: typeof ItemCreateValidationError;
|
|
450
|
+
UnknownModelError: typeof UnknownModelError;
|
|
451
|
+
}>;
|
|
452
|
+
/**
|
|
453
|
+
* Called by Schema.destroy before it evicts the schema's models; `finishSchemaDestroy` once its rows
|
|
454
|
+
* are gone. The schema's actor stays live until then, and work it starts meanwhile (its live query
|
|
455
|
+
* reading a model row the drained write just landed) captures an epoch after the eviction, so the
|
|
456
|
+
* epoch alone can't tell it to stay away.
|
|
457
|
+
*/
|
|
458
|
+
declare function recordSchemaDestroy(schemaName: any): void;
|
|
459
|
+
/**
|
|
460
|
+
* True when the schema is being destroyed, or its instances were evicted after `since` (an epoch
|
|
461
|
+
* from currentEvictionEpoch).
|
|
462
|
+
*/
|
|
463
|
+
declare function schemaEvictedSince(schemaName: any, since: any): boolean;
|
|
464
|
+
/** Run a background draft save, recording its failure (or clearing an earlier one on success). */
|
|
465
|
+
declare function trackDraftSave(service: any, save: any, label: any): void;
|
|
466
|
+
declare const writeProcessMachine: import("xstate").StateMachine<{}, import("xstate").AnyEventObject, {
|
|
467
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject> | import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>> | undefined;
|
|
468
|
+
}, {
|
|
469
|
+
src: "validateEntity";
|
|
470
|
+
logic: import("xstate").PromiseActorLogic<any, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
471
|
+
id: string | undefined;
|
|
472
|
+
} | {
|
|
473
|
+
src: "writeToDatabase";
|
|
474
|
+
logic: import("xstate").CallbackActorLogic<import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").EventObject>;
|
|
475
|
+
id: string | undefined;
|
|
476
|
+
}, never, never, never, "error" | "idle" | "validating" | "writing" | "success", string, {}, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
477
|
+
id: "writeProcess";
|
|
478
|
+
states: {
|
|
479
|
+
readonly idle: {};
|
|
480
|
+
readonly validating: {};
|
|
481
|
+
readonly writing: {};
|
|
482
|
+
readonly success: {};
|
|
483
|
+
readonly error: {};
|
|
484
|
+
};
|
|
485
|
+
}, import("xstate").MetaObject>;
|
|
486
|
+
export { ConflictError as C, ItemCreateValidationError as I, Model as M, TModelSchema as T, UnknownModelError as U, TModelValues as a, anyEvictionSince as b, currentEvictionEpoch as c, setupEntityLiveQuery as d, writeToDatabase$1 as e, finishSchemaDestroy as f, getDraftSaveError as g, Model$1 as h, isActorStopped as i, errors as j, recordSchemaDestroy as r, schemaEvictedSince as s, trackDraftSave as t, writeProcessMachine as w };
|
|
487
|
+
//# sourceMappingURL=errors-3tc6XkCB.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-3tc6XkCB.d.ts","sourceRoot":"","sources":["../errors-3tc6XkCB.js"],"names":[],"mappings":"AA2uDA;;GAEG;AACH;IACI,yCAKC;IAFG,cAAwB;CAG/B;AA0uED;;;;;GAKG;AACH;IACI,2CAMC;IAHG,eAA0B;IAC1B,cAAwB;CAG/B;AAl/DD;IACI,gEAOC;IACD,gDAIC;IAsCD;;;OAGG;IACH,iEAuBC;IACD;;;;OAIG;IACH,0DAkBC;IACD;;;;OAIG;IACH,gEAEC;IACD;;;;;;;;OAQG;IACH,0FA6DC;IACD,0EAonBC;IACD;;OAEG;IACH,sCAWC;IACD;;;;;;OAMG;IACH,uDAaC;IACD,yGAAyG;IACzG,4DAcC;IACD;;;OAGG;IACH,gDAcC;IACD;;;;;OAKG;IACH,4CAQC;IACD;;;OAGG;IACH,2DAyBC;IACD;;;OAGG;IACH,8DA6CC;IACD;;;;;;;OAOG;IACH,mFA4DC;IACD;;;;;;OAMG;IACH,gEA4DC;IACD;;;;;OAKG;IACH;;;;;;qBAoBC;IACD;;;;;;OAMG;IACH,+DA4DC;IACD;;;;;OAKG;IACH,0DA8FC;IACD;;OAEG;IACH,4FAeC;IAmTD;;;;;OAKG;IACH,8CAuCC;IAmSD;;;;OAIG;IACH,0DAkBC;IA37DD,8FAmCC;IAzBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAEE;IAsxCN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAEC;IACD;;;;;;;;;;;;;;;;;;;;;;;;OAEC;IACD,0BAEC;IACD;;;OAGG;IACH;;OA+BC;IACD;;;;;OAKG;IACH,0DAgGC;IACD,iBAEC;IACD,mGAAmG;IACnG,yBAEC;IACD,4BAEC;IACD,uBAGC;IACD,oBAcC;IACD,cAEC;IACD,gBAEC;IACD;;;;OAIG;IACH,wBA8BC;IACD;;;OAGG;IACH,yBA8BC;IACD;;;;;;;;;;OAUG;IACH,kCAWC;IACD;;;OAGG;IACH,uBAwBC;IA+CD;;OAEG;IACH,eA4BC;IACD;;;OAGG;IACH,yBAsEC;IACD;;;OAGG;IACH,oCAsGC;IACD;;OAEG;IACH,0CAkEC;IACD;;OAEG;IACH,mCAEC;CAyBJ;;;;;;;;;;;AAuBD;;;;;;;;;;;;;;;;;;;;;;;IAA2D;AAiB3D,+FAA+F;AAC/F;IACI,6CAMC;IAHG,eAA0B;IAC1B,gBAA4B;CAGnC;AA3BD,uIAA4D;AAxnG5D;;;GAGG;AACH,uDAEC;AA3ED,gDAEC;AAs9BD;;;;;;GAMG;AACH,wEAyJC;AAzxBD;;;;GAIG;AAjVH,4DAQC;AAkpCD,sDAEC;AAygED;;;GAGG;AA/8HH;;;GAGG;AACH;;GAEG;AACH;;;;GAIG;AACH,qDAEC;AAi+HD;;;;GAIG;AAttGH;;;;;GAKG;AACH,4DAGC;AAUD;;;GAGG;AACH,0EAQC;AAwoCD,kGAAkG;AAClG,2EAQC;AAl1BD;;;;;;;;;;;;;;;;;;;gCA2NG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown by client init in the browser when SQLite can't store the database in OPFS. SQLite's OPFS
|
|
3
|
+
* storage needs `SharedArrayBuffer`, which browsers only expose on cross-origin isolated pages
|
|
4
|
+
* (COOP `same-origin` and COEP `require-corp` or `credentialless` response headers). Without it,
|
|
5
|
+
* SQLocal falls back to an in-memory database and every reload would lose the app's data, so init
|
|
6
|
+
* fails instead. Hosts can check `code === 'DB_NOT_PERSISTENT'`.
|
|
7
|
+
*/
|
|
8
|
+
declare class DatabaseNotPersistentError extends Error {
|
|
9
|
+
constructor(detail: any);
|
|
10
|
+
code: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Thrown by client init when the browser file system can't be mounted because OPFS entries are
|
|
14
|
+
* held by another context — usually another tab of the same app, or a worker from a page that
|
|
15
|
+
* was just reloaded. Hosts can check `code === 'OPFS_LOCKED'` and offer "close other tabs / retry".
|
|
16
|
+
*/
|
|
17
|
+
declare class FileSystemLockedError extends Error {
|
|
18
|
+
constructor(cause: any);
|
|
19
|
+
code: string;
|
|
20
|
+
}
|
|
21
|
+
export { DatabaseNotPersistentError as D, FileSystemLockedError as F };
|
|
22
|
+
//# sourceMappingURL=errors-Do7v6RKu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-Do7v6RKu.d.ts","sourceRoot":"","sources":["../errors-Do7v6RKu.js"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH;IACI,yBAOC;IAFG,aAA+B;CAGtC;AA9BD;;;;GAIG;AACH;IACI,wBAMC;IAFG,aAAyB;CAGhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getItem-DM3a-7XE.d.ts","sourceRoot":"","sources":["../getItem-DM3a-7XE.js"],"names":[],"mappings":"AAqBA;;;;iBAoBC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Error thrown when publish validation fails. Includes all validation errors for user to fix. */
|
|
2
|
+
declare class PublishValidationFailedError extends Error {
|
|
3
|
+
constructor(message: any, validationErrors: any);
|
|
4
|
+
validationErrors: any;
|
|
5
|
+
}
|
|
6
|
+
/** Validation error code for a relation, list member or image/file ref to an unpublished seed. */
|
|
7
|
+
declare const RELATED_ITEM_UNPUBLISHED_CODE: "related_item_unpublished";
|
|
8
|
+
/**
|
|
9
|
+
* Thrown before anything is uploaded or attested when the item references items whose seed was
|
|
10
|
+
* unpublished: the parent would attest a revoked seed uid. Republish those items (which gives
|
|
11
|
+
* them a new seed uid) or remove the references, then publish again.
|
|
12
|
+
* See docs/ATTESTATION_REVOCATION.md ("Republishing").
|
|
13
|
+
*
|
|
14
|
+
* A PublishValidationFailedError, so validateItemForPublish and the publish package's checking
|
|
15
|
+
* step report it as validation errors (code `related_item_unpublished`, one per reference).
|
|
16
|
+
*/
|
|
17
|
+
declare class RelatedItemUnpublishedError extends PublishValidationFailedError {
|
|
18
|
+
constructor(unpublishedRelatedItems: any, otherValidationErrors?: any[]);
|
|
19
|
+
unpublishedRelatedItems: any;
|
|
20
|
+
}
|
|
21
|
+
declare var getPublishPayload$1: Readonly<{
|
|
22
|
+
__proto__: null;
|
|
23
|
+
PublishValidationFailedError: typeof PublishValidationFailedError;
|
|
24
|
+
getPublishPayload: (item: any, uploadedTransactions: any, options: any) => Promise<any>;
|
|
25
|
+
resolvePublishPayloadValues: (multiPayload: any, resolvedUids: any) => Promise<any>;
|
|
26
|
+
validateItemForPublish: (item: any, uploadedTransactions: any[] | undefined, options: any) => Promise<{
|
|
27
|
+
isValid: boolean;
|
|
28
|
+
errors: any;
|
|
29
|
+
}>;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves relation/image property values (seedLocalId) to attestation uids after dependent seeds are published.
|
|
33
|
+
* Call after each payload is published, passing the returned attestation uid for that seed's localId.
|
|
34
|
+
* Returns an updated multiPayload with re-encoded attestations where resolution was applied.
|
|
35
|
+
*/
|
|
36
|
+
declare function resolvePublishPayloadValues(multiPayload: any, resolvedUids: any): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Validates an item for publishing without performing Arweave or EAS work.
|
|
39
|
+
* Use in the checking step to fail fast before creating transactions.
|
|
40
|
+
* Pass empty array for uploadedTransactions when validating before Arweave upload.
|
|
41
|
+
*/
|
|
42
|
+
declare function validateItemForPublish(item: any, uploadedTransactions: any[] | undefined, options: any): Promise<{
|
|
43
|
+
isValid: boolean;
|
|
44
|
+
errors: any;
|
|
45
|
+
}>;
|
|
46
|
+
export { PublishValidationFailedError as P, RELATED_ITEM_UNPUBLISHED_CODE as R, RelatedItemUnpublishedError as a, getPublishPayload$1 as g, resolvePublishPayloadValues as r, validateItemForPublish as v };
|
|
47
|
+
//# sourceMappingURL=getPublishPayload-CJF0k5d8.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPublishPayload-CJF0k5d8.d.ts","sourceRoot":"","sources":["../getPublishPayload-CJF0k5d8.js"],"names":[],"mappings":"AA2DA,kGAAkG;AAClG;IACI,iDAIC;IAFG,sBAAwC;CAG/C;AACD,kGAAkG;AAClG,6CAAsC,0BAA0B,CAAC;AAEjE;;;;;;;;GAQG;AACH;IACI,yEAgBC;IADG,6BAAsD;CAE7D;AA6/CD;;;;;;;;;GAMG;AAnHH;;;;GAIG;AACH,iGAsGC;AAjRD;;;;GAIG;AACH;;;GAWC"}
|