@sidekickdb/platform 0.0.0 → 2.0.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/.tshy/build.json +8 -0
- package/.tshy/commonjs.json +16 -0
- package/.tshy/esm.json +15 -0
- package/.turbo/turbo-build.log +50 -0
- package/LICENSE.md +202 -0
- package/NOTICE +27 -0
- package/README.md +444 -2
- package/__tests__/src/apiURI.test.ts +58 -0
- package/__tests__/src/backupDownload.test.ts +427 -0
- package/__tests__/src/backups.test.ts +168 -0
- package/__tests__/src/clerk.test.ts +13 -0
- package/__tests__/src/consts.test.ts +11 -0
- package/__tests__/src/migrations.test.ts +885 -0
- package/__tests__/src/perms.test.ts +102 -0
- package/__tests__/src/rename.test.ts +126 -0
- package/__tests__/src/schema.push.e2e.test.ts +186 -0
- package/__tests__/src/schema.test.ts +644 -0
- package/__tests__/src/typescript-schema.test.ts +117 -0
- package/dist/commonjs/ProgressPromise.d.ts +18 -0
- package/dist/commonjs/ProgressPromise.d.ts.map +1 -0
- package/dist/commonjs/ProgressPromise.js +77 -0
- package/dist/commonjs/ProgressPromise.js.map +1 -0
- package/dist/commonjs/api.d.ts +480 -0
- package/dist/commonjs/api.d.ts.map +1 -0
- package/dist/commonjs/api.js +1132 -0
- package/dist/commonjs/api.js.map +1 -0
- package/dist/commonjs/backupDownload.d.ts +89 -0
- package/dist/commonjs/backupDownload.d.ts.map +1 -0
- package/dist/commonjs/backupDownload.js +357 -0
- package/dist/commonjs/backupDownload.js.map +1 -0
- package/dist/commonjs/backups.d.ts +146 -0
- package/dist/commonjs/backups.d.ts.map +1 -0
- package/dist/commonjs/backups.js +248 -0
- package/dist/commonjs/backups.js.map +1 -0
- package/dist/commonjs/clerk.d.ts +2 -0
- package/dist/commonjs/clerk.d.ts.map +1 -0
- package/dist/commonjs/clerk.js +29 -0
- package/dist/commonjs/clerk.js.map +1 -0
- package/dist/commonjs/consts.d.ts +11 -0
- package/dist/commonjs/consts.d.ts.map +1 -0
- package/dist/commonjs/consts.js +17 -0
- package/dist/commonjs/consts.js.map +1 -0
- package/dist/commonjs/crypto.d.ts +4 -0
- package/dist/commonjs/crypto.d.ts.map +1 -0
- package/dist/commonjs/crypto.js +26 -0
- package/dist/commonjs/crypto.js.map +1 -0
- package/dist/commonjs/index.d.ts +18 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +61 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/migrationUtils.d.ts +4 -0
- package/dist/commonjs/migrationUtils.d.ts.map +1 -0
- package/dist/commonjs/migrationUtils.js +52 -0
- package/dist/commonjs/migrationUtils.js.map +1 -0
- package/dist/commonjs/migrations.d.ts +99 -0
- package/dist/commonjs/migrations.d.ts.map +1 -0
- package/dist/commonjs/migrations.js +597 -0
- package/dist/commonjs/migrations.js.map +1 -0
- package/dist/commonjs/oauth.d.ts +98 -0
- package/dist/commonjs/oauth.d.ts.map +1 -0
- package/dist/commonjs/oauth.js +277 -0
- package/dist/commonjs/oauth.js.map +1 -0
- package/dist/commonjs/oauthCommon.d.ts +12 -0
- package/dist/commonjs/oauthCommon.d.ts.map +1 -0
- package/dist/commonjs/oauthCommon.js +26 -0
- package/dist/commonjs/oauthCommon.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/perms.d.ts +3 -0
- package/dist/commonjs/perms.d.ts.map +1 -0
- package/dist/commonjs/perms.js +66 -0
- package/dist/commonjs/perms.js.map +1 -0
- package/dist/commonjs/relationships.d.ts +7 -0
- package/dist/commonjs/relationships.d.ts.map +1 -0
- package/dist/commonjs/relationships.js +46 -0
- package/dist/commonjs/relationships.js.map +1 -0
- package/dist/commonjs/schema.d.ts +161 -0
- package/dist/commonjs/schema.d.ts.map +1 -0
- package/dist/commonjs/schema.js +174 -0
- package/dist/commonjs/schema.js.map +1 -0
- package/dist/commonjs/serverOAuth.d.ts +25 -0
- package/dist/commonjs/serverOAuth.d.ts.map +1 -0
- package/dist/commonjs/serverOAuth.js +72 -0
- package/dist/commonjs/serverOAuth.js.map +1 -0
- package/dist/commonjs/typescript-schema.d.ts +17 -0
- package/dist/commonjs/typescript-schema.d.ts.map +1 -0
- package/dist/commonjs/typescript-schema.js +314 -0
- package/dist/commonjs/typescript-schema.js.map +1 -0
- package/dist/commonjs/util.d.ts +13 -0
- package/dist/commonjs/util.d.ts.map +1 -0
- package/dist/commonjs/util.js +55 -0
- package/dist/commonjs/util.js.map +1 -0
- package/dist/commonjs/version.d.ts +3 -0
- package/dist/commonjs/version.d.ts.map +1 -0
- package/dist/commonjs/version.js +5 -0
- package/dist/commonjs/version.js.map +1 -0
- package/dist/esm/ProgressPromise.d.ts +18 -0
- package/dist/esm/ProgressPromise.d.ts.map +1 -0
- package/dist/esm/ProgressPromise.js +73 -0
- package/dist/esm/ProgressPromise.js.map +1 -0
- package/dist/esm/api.d.ts +480 -0
- package/dist/esm/api.d.ts.map +1 -0
- package/dist/esm/api.js +1121 -0
- package/dist/esm/api.js.map +1 -0
- package/dist/esm/backupDownload.d.ts +89 -0
- package/dist/esm/backupDownload.d.ts.map +1 -0
- package/dist/esm/backupDownload.js +354 -0
- package/dist/esm/backupDownload.js.map +1 -0
- package/dist/esm/backups.d.ts +146 -0
- package/dist/esm/backups.d.ts.map +1 -0
- package/dist/esm/backups.js +237 -0
- package/dist/esm/backups.js.map +1 -0
- package/dist/esm/clerk.d.ts +2 -0
- package/dist/esm/clerk.d.ts.map +1 -0
- package/dist/esm/clerk.js +26 -0
- package/dist/esm/clerk.js.map +1 -0
- package/dist/esm/consts.d.ts +11 -0
- package/dist/esm/consts.d.ts.map +1 -0
- package/dist/esm/consts.js +13 -0
- package/dist/esm/consts.js.map +1 -0
- package/dist/esm/crypto.d.ts +4 -0
- package/dist/esm/crypto.d.ts.map +1 -0
- package/dist/esm/crypto.js +21 -0
- package/dist/esm/crypto.js.map +1 -0
- package/dist/esm/index.d.ts +18 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/migrationUtils.d.ts +4 -0
- package/dist/esm/migrationUtils.d.ts.map +1 -0
- package/dist/esm/migrationUtils.js +47 -0
- package/dist/esm/migrationUtils.js.map +1 -0
- package/dist/esm/migrations.d.ts +99 -0
- package/dist/esm/migrations.d.ts.map +1 -0
- package/dist/esm/migrations.js +588 -0
- package/dist/esm/migrations.js.map +1 -0
- package/dist/esm/oauth.d.ts +98 -0
- package/dist/esm/oauth.d.ts.map +1 -0
- package/dist/esm/oauth.js +268 -0
- package/dist/esm/oauth.js.map +1 -0
- package/dist/esm/oauthCommon.d.ts +12 -0
- package/dist/esm/oauthCommon.d.ts.map +1 -0
- package/dist/esm/oauthCommon.js +22 -0
- package/dist/esm/oauthCommon.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/perms.d.ts +3 -0
- package/dist/esm/perms.d.ts.map +1 -0
- package/dist/esm/perms.js +62 -0
- package/dist/esm/perms.js.map +1 -0
- package/dist/esm/relationships.d.ts +7 -0
- package/dist/esm/relationships.d.ts.map +1 -0
- package/dist/esm/relationships.js +43 -0
- package/dist/esm/relationships.js.map +1 -0
- package/dist/esm/schema.d.ts +161 -0
- package/dist/esm/schema.d.ts.map +1 -0
- package/dist/esm/schema.js +158 -0
- package/dist/esm/schema.js.map +1 -0
- package/dist/esm/serverOAuth.d.ts +25 -0
- package/dist/esm/serverOAuth.d.ts.map +1 -0
- package/dist/esm/serverOAuth.js +68 -0
- package/dist/esm/serverOAuth.js.map +1 -0
- package/dist/esm/typescript-schema.d.ts +17 -0
- package/dist/esm/typescript-schema.d.ts.map +1 -0
- package/dist/esm/typescript-schema.js +310 -0
- package/dist/esm/typescript-schema.js.map +1 -0
- package/dist/esm/util.d.ts +13 -0
- package/dist/esm/util.d.ts.map +1 -0
- package/dist/esm/util.js +46 -0
- package/dist/esm/util.js.map +1 -0
- package/dist/esm/version.d.ts +3 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +3 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/standalone/index.js +13747 -0
- package/dist/standalone/index.umd.cjs +72 -0
- package/package.json +69 -3
- package/src/ProgressPromise.ts +97 -0
- package/src/api.ts +1903 -0
- package/src/backupDownload.ts +519 -0
- package/src/backups.ts +342 -0
- package/src/clerk.ts +24 -0
- package/src/consts.ts +22 -0
- package/src/crypto.ts +28 -0
- package/src/index.ts +147 -0
- package/src/migrationUtils.ts +56 -0
- package/src/migrations.ts +920 -0
- package/src/oauth.ts +390 -0
- package/src/oauthCommon.ts +38 -0
- package/src/perms.ts +81 -0
- package/src/relationships.ts +57 -0
- package/src/schema.ts +497 -0
- package/src/serverOAuth.ts +119 -0
- package/src/typescript-schema.ts +439 -0
- package/src/util.ts +77 -0
- package/src/version.ts +3 -0
- package/tsconfig.dev.json +14 -0
- package/tsconfig.json +14 -0
- package/vite.config.ts +19 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InstantOAuthError, type OAuthScope } from './oauthCommon.ts';
|
|
2
|
+
import { type InstantDBOAuthAccessToken, type OAuthHandlerConfig, OAuthHandler } from './oauth.ts';
|
|
3
|
+
import { generatePermsTypescriptFile, permsTypescriptFileToCode } from './perms.ts';
|
|
4
|
+
import { type InstantAPIPlatformSchema, generateSchemaTypescriptFile, collectSystemCatalogIdentNames, validateSchema, SchemaValidationError } from './schema.ts';
|
|
5
|
+
import { apiSchemaToInstantSchemaDef, PlatformApi, translatePlanSteps } from './api.ts';
|
|
6
|
+
import { schemaTypescriptFileToInstantSchema } from './typescript-schema.ts';
|
|
7
|
+
import version from './version.ts';
|
|
8
|
+
import { ProgressPromise } from './ProgressPromise.ts';
|
|
9
|
+
import { i, type InstantRules, type InstantRouteHandlerPayloadByType, type InstantRouteHandlerType, type InstantRouteHandlerBody } from '@sidekickdb/core';
|
|
10
|
+
import { exchangeCodeForToken, exchangeRefreshToken } from './serverOAuth.ts';
|
|
11
|
+
import { clerkDomainFromPublishableKey } from './clerk.ts';
|
|
12
|
+
import { Webhooks, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams, WebhooksManager } from '@sidekickdb/webhooks';
|
|
13
|
+
export { type InstantAPIPlatformSchema, type InstantDBOAuthAccessToken, type OAuthHandlerConfig, type OAuthScope, type InstantRules, type InstantRouteHandlerPayloadByType, type InstantRouteHandlerType, type InstantRouteHandlerBody, OAuthHandler, InstantOAuthError, generateSchemaTypescriptFile, collectSystemCatalogIdentNames, validateSchema, SchemaValidationError, generatePermsTypescriptFile, permsTypescriptFileToCode, apiSchemaToInstantSchemaDef, schemaTypescriptFileToInstantSchema, version, translatePlanSteps, PlatformApi, ProgressPromise, exchangeCodeForToken, exchangeRefreshToken, clerkDomainFromPublishableKey, i, Webhooks, WebhooksManager, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams, };
|
|
14
|
+
export { diffSchemas, convertTxSteps, isRenamePromptItem, buildAutoRenameSelector, type RenameResolveFn, type MigrationTx, type MigrationTxSpecific, type MigrationTxTypes, type Identifier, } from './migrations.ts';
|
|
15
|
+
export { BackupsManager, backupZipName, estimateZipSize, formatFileSize, toAppBackup, type AppBackup, type AppBackupFile, type AppBackupStorageFile, } from './backups.ts';
|
|
16
|
+
export { type DownloadBackupArchiveOpts, type BackupArchiveWriter, type BackupDownloadProgress, type BackupDownloadResult, } from './backupDownload.ts';
|
|
17
|
+
export { oauthCallbackURL, GOOGLE_AUTHORIZATION_ENDPOINT, GOOGLE_DISCOVERY_ENDPOINT, GOOGLE_TOKEN_ENDPOINT, APPLE_AUTHORIZATION_ENDPOINT, APPLE_DISCOVERY_ENDPOINT, APPLE_TOKEN_ENDPOINT, LINKEDIN_AUTHORIZATION_ENDPOINT, LINKEDIN_DISCOVERY_ENDPOINT, LINKEDIN_TOKEN_ENDPOINT, } from './consts.ts';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,YAAY,EACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,wBAAwB,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,2BAA2B,EAC3B,WAAW,EACX,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,CAAC,EACD,KAAK,YAAY,EACjB,KAAK,gCAAgC,EACrC,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EACL,QAAQ,EACR,KA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AAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,WAAW,EACX,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LINKEDIN_TOKEN_ENDPOINT = exports.LINKEDIN_DISCOVERY_ENDPOINT = exports.LINKEDIN_AUTHORIZATION_ENDPOINT = exports.APPLE_TOKEN_ENDPOINT = exports.APPLE_DISCOVERY_ENDPOINT = exports.APPLE_AUTHORIZATION_ENDPOINT = exports.GOOGLE_TOKEN_ENDPOINT = exports.GOOGLE_DISCOVERY_ENDPOINT = exports.GOOGLE_AUTHORIZATION_ENDPOINT = exports.oauthCallbackURL = exports.toAppBackup = exports.formatFileSize = exports.estimateZipSize = exports.backupZipName = exports.BackupsManager = exports.buildAutoRenameSelector = exports.isRenamePromptItem = exports.convertTxSteps = exports.diffSchemas = exports.WebhooksManager = exports.Webhooks = exports.i = exports.clerkDomainFromPublishableKey = exports.exchangeRefreshToken = exports.exchangeCodeForToken = exports.ProgressPromise = exports.PlatformApi = exports.translatePlanSteps = exports.version = exports.schemaTypescriptFileToInstantSchema = exports.apiSchemaToInstantSchemaDef = exports.permsTypescriptFileToCode = exports.generatePermsTypescriptFile = exports.SchemaValidationError = exports.validateSchema = exports.collectSystemCatalogIdentNames = exports.generateSchemaTypescriptFile = exports.InstantOAuthError = exports.OAuthHandler = void 0;
|
|
7
|
+
const oauthCommon_ts_1 = require("./oauthCommon.js");
|
|
8
|
+
Object.defineProperty(exports, "InstantOAuthError", { enumerable: true, get: function () { return oauthCommon_ts_1.InstantOAuthError; } });
|
|
9
|
+
const oauth_ts_1 = require("./oauth.js");
|
|
10
|
+
Object.defineProperty(exports, "OAuthHandler", { enumerable: true, get: function () { return oauth_ts_1.OAuthHandler; } });
|
|
11
|
+
const perms_ts_1 = require("./perms.js");
|
|
12
|
+
Object.defineProperty(exports, "generatePermsTypescriptFile", { enumerable: true, get: function () { return perms_ts_1.generatePermsTypescriptFile; } });
|
|
13
|
+
Object.defineProperty(exports, "permsTypescriptFileToCode", { enumerable: true, get: function () { return perms_ts_1.permsTypescriptFileToCode; } });
|
|
14
|
+
const schema_ts_1 = require("./schema.js");
|
|
15
|
+
Object.defineProperty(exports, "generateSchemaTypescriptFile", { enumerable: true, get: function () { return schema_ts_1.generateSchemaTypescriptFile; } });
|
|
16
|
+
Object.defineProperty(exports, "collectSystemCatalogIdentNames", { enumerable: true, get: function () { return schema_ts_1.collectSystemCatalogIdentNames; } });
|
|
17
|
+
Object.defineProperty(exports, "validateSchema", { enumerable: true, get: function () { return schema_ts_1.validateSchema; } });
|
|
18
|
+
Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return schema_ts_1.SchemaValidationError; } });
|
|
19
|
+
const api_ts_1 = require("./api.js");
|
|
20
|
+
Object.defineProperty(exports, "apiSchemaToInstantSchemaDef", { enumerable: true, get: function () { return api_ts_1.apiSchemaToInstantSchemaDef; } });
|
|
21
|
+
Object.defineProperty(exports, "PlatformApi", { enumerable: true, get: function () { return api_ts_1.PlatformApi; } });
|
|
22
|
+
Object.defineProperty(exports, "translatePlanSteps", { enumerable: true, get: function () { return api_ts_1.translatePlanSteps; } });
|
|
23
|
+
const typescript_schema_ts_1 = require("./typescript-schema.js");
|
|
24
|
+
Object.defineProperty(exports, "schemaTypescriptFileToInstantSchema", { enumerable: true, get: function () { return typescript_schema_ts_1.schemaTypescriptFileToInstantSchema; } });
|
|
25
|
+
const version_ts_1 = __importDefault(require("./version.js"));
|
|
26
|
+
exports.version = version_ts_1.default;
|
|
27
|
+
const ProgressPromise_ts_1 = require("./ProgressPromise.js");
|
|
28
|
+
Object.defineProperty(exports, "ProgressPromise", { enumerable: true, get: function () { return ProgressPromise_ts_1.ProgressPromise; } });
|
|
29
|
+
const core_1 = require("@sidekickdb/core");
|
|
30
|
+
Object.defineProperty(exports, "i", { enumerable: true, get: function () { return core_1.i; } });
|
|
31
|
+
const serverOAuth_ts_1 = require("./serverOAuth.js");
|
|
32
|
+
Object.defineProperty(exports, "exchangeCodeForToken", { enumerable: true, get: function () { return serverOAuth_ts_1.exchangeCodeForToken; } });
|
|
33
|
+
Object.defineProperty(exports, "exchangeRefreshToken", { enumerable: true, get: function () { return serverOAuth_ts_1.exchangeRefreshToken; } });
|
|
34
|
+
const clerk_ts_1 = require("./clerk.js");
|
|
35
|
+
Object.defineProperty(exports, "clerkDomainFromPublishableKey", { enumerable: true, get: function () { return clerk_ts_1.clerkDomainFromPublishableKey; } });
|
|
36
|
+
const webhooks_1 = require("@sidekickdb/webhooks");
|
|
37
|
+
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
|
|
38
|
+
Object.defineProperty(exports, "WebhooksManager", { enumerable: true, get: function () { return webhooks_1.WebhooksManager; } });
|
|
39
|
+
var migrations_ts_1 = require("./migrations.js");
|
|
40
|
+
Object.defineProperty(exports, "diffSchemas", { enumerable: true, get: function () { return migrations_ts_1.diffSchemas; } });
|
|
41
|
+
Object.defineProperty(exports, "convertTxSteps", { enumerable: true, get: function () { return migrations_ts_1.convertTxSteps; } });
|
|
42
|
+
Object.defineProperty(exports, "isRenamePromptItem", { enumerable: true, get: function () { return migrations_ts_1.isRenamePromptItem; } });
|
|
43
|
+
Object.defineProperty(exports, "buildAutoRenameSelector", { enumerable: true, get: function () { return migrations_ts_1.buildAutoRenameSelector; } });
|
|
44
|
+
var backups_ts_1 = require("./backups.js");
|
|
45
|
+
Object.defineProperty(exports, "BackupsManager", { enumerable: true, get: function () { return backups_ts_1.BackupsManager; } });
|
|
46
|
+
Object.defineProperty(exports, "backupZipName", { enumerable: true, get: function () { return backups_ts_1.backupZipName; } });
|
|
47
|
+
Object.defineProperty(exports, "estimateZipSize", { enumerable: true, get: function () { return backups_ts_1.estimateZipSize; } });
|
|
48
|
+
Object.defineProperty(exports, "formatFileSize", { enumerable: true, get: function () { return backups_ts_1.formatFileSize; } });
|
|
49
|
+
Object.defineProperty(exports, "toAppBackup", { enumerable: true, get: function () { return backups_ts_1.toAppBackup; } });
|
|
50
|
+
var consts_ts_1 = require("./consts.js");
|
|
51
|
+
Object.defineProperty(exports, "oauthCallbackURL", { enumerable: true, get: function () { return consts_ts_1.oauthCallbackURL; } });
|
|
52
|
+
Object.defineProperty(exports, "GOOGLE_AUTHORIZATION_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.GOOGLE_AUTHORIZATION_ENDPOINT; } });
|
|
53
|
+
Object.defineProperty(exports, "GOOGLE_DISCOVERY_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.GOOGLE_DISCOVERY_ENDPOINT; } });
|
|
54
|
+
Object.defineProperty(exports, "GOOGLE_TOKEN_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.GOOGLE_TOKEN_ENDPOINT; } });
|
|
55
|
+
Object.defineProperty(exports, "APPLE_AUTHORIZATION_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.APPLE_AUTHORIZATION_ENDPOINT; } });
|
|
56
|
+
Object.defineProperty(exports, "APPLE_DISCOVERY_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.APPLE_DISCOVERY_ENDPOINT; } });
|
|
57
|
+
Object.defineProperty(exports, "APPLE_TOKEN_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.APPLE_TOKEN_ENDPOINT; } });
|
|
58
|
+
Object.defineProperty(exports, "LINKEDIN_AUTHORIZATION_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.LINKEDIN_AUTHORIZATION_ENDPOINT; } });
|
|
59
|
+
Object.defineProperty(exports, "LINKEDIN_DISCOVERY_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.LINKEDIN_DISCOVERY_ENDPOINT; } });
|
|
60
|
+
Object.defineProperty(exports, "LINKEDIN_TOKEN_ENDPOINT", { enumerable: true, get: function () { return consts_ts_1.LINKEDIN_TOKEN_ENDPOINT; } });
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAsE;AAmEpE,kGAnEO,kCAAiB,OAmEP;AAlEnB,yCAIoB;AA6DlB,6FA9DA,uBAAY,OA8DA;AA5Dd,yCAGoB;AA+DlB,4GAjEA,sCAA2B,OAiEA;AAC3B,0GAjEA,oCAAyB,OAiEA;AA/D3B,2CAMqB;AAoDnB,6GAxDA,wCAA4B,OAwDA;AAC5B,+GAxDA,0CAA8B,OAwDA;AAC9B,+FAxDA,0BAAc,OAwDA;AACd,sGAxDA,iCAAqB,OAwDA;AAtDvB,qCAIkB;AAqDhB,4GAxDA,oCAA2B,OAwDA;AAI3B,4FA3DA,oBAAW,OA2DA;AADX,mGAzDA,2BAAkB,OAyDA;AAvDpB,iEAA6E;AAqD3E,oHArDO,0DAAmC,OAqDP;AAnDrC,8DAAmC;AAoDjC,kBApDK,oBAAO,CAoDL;AAnDT,6DAAuD;AAsDrD,gGAtDO,oCAAe,OAsDP;AArDjB,2CAM0B;AAmDxB,kFAxDA,QAAC,OAwDA;AAlDH,qDAA8E;AA+C5E,qGA/CO,qCAAoB,OA+CP;AACpB,qGAhD6B,qCAAoB,OAgD7B;AA/CtB,yCAA2D;AAgDzD,8GAhDO,wCAA6B,OAgDP;AA/C/B,mDAoB8B;AA6B5B,yFAhDA,mBAAQ,OAgDA;AACR,gGA/BA,0BAAe,OA+BA;AAoBjB,iDAUyB;AATvB,4GAAA,WAAW,OAAA;AACX,+GAAA,cAAc,OAAA;AACd,mHAAA,kBAAkB,OAAA;AAClB,wHAAA,uBAAuB,OAAA;AAQzB,2CASsB;AARpB,4GAAA,cAAc,OAAA;AACd,2GAAA,aAAa,OAAA;AACb,6GAAA,eAAe,OAAA;AACf,4GAAA,cAAc,OAAA;AACd,yGAAA,WAAW,OAAA;AAab,yCAWqB;AAVnB,6GAAA,gBAAgB,OAAA;AAChB,0HAAA,6BAA6B,OAAA;AAC7B,sHAAA,yBAAyB,OAAA;AACzB,kHAAA,qBAAqB,OAAA;AACrB,yHAAA,4BAA4B,OAAA;AAC5B,qHAAA,wBAAwB,OAAA;AACxB,iHAAA,oBAAoB,OAAA;AACpB,4HAAA,+BAA+B,OAAA;AAC/B,wHAAA,2BAA2B,OAAA;AAC3B,oHAAA,uBAAuB,OAAA","sourcesContent":["import { InstantOAuthError, type OAuthScope } from './oauthCommon.ts';\nimport {\n type InstantDBOAuthAccessToken,\n type OAuthHandlerConfig,\n OAuthHandler,\n} from './oauth.ts';\nimport {\n generatePermsTypescriptFile,\n permsTypescriptFileToCode,\n} from './perms.ts';\nimport {\n type InstantAPIPlatformSchema,\n generateSchemaTypescriptFile,\n collectSystemCatalogIdentNames,\n validateSchema,\n SchemaValidationError,\n} from './schema.ts';\nimport {\n apiSchemaToInstantSchemaDef,\n PlatformApi,\n translatePlanSteps,\n} from './api.ts';\nimport { schemaTypescriptFileToInstantSchema } from './typescript-schema.ts';\n\nimport version from './version.ts';\nimport { ProgressPromise } from './ProgressPromise.ts';\nimport {\n i,\n type InstantRules,\n type InstantRouteHandlerPayloadByType,\n type InstantRouteHandlerType,\n type InstantRouteHandlerBody,\n} from '@sidekickdb/core';\nimport { exchangeCodeForToken, exchangeRefreshToken } from './serverOAuth.ts';\nimport { clerkDomainFromPublishableKey } from './clerk.ts';\nimport {\n Webhooks,\n type WebhookAction,\n type WebhookStatus,\n type WebhookEventStatus,\n type WebhookInfo,\n type WebhookAttempt,\n type WebhookEventInfo,\n type WebhookEventsPage,\n type WebhookBody,\n type WebhookEntity,\n type WebhookPayload,\n type WebhookPayloadRecord,\n type WebhookPayloadRecordFor,\n type WebhookHandlerFn,\n type WebhookHandlers,\n type WebhookHelpers,\n type CreateWebhookParams,\n type UpdateWebhookParams,\n WebhooksManager,\n} from '@sidekickdb/webhooks';\n\nexport {\n type InstantAPIPlatformSchema,\n type InstantDBOAuthAccessToken,\n type OAuthHandlerConfig,\n type OAuthScope,\n type InstantRules,\n type InstantRouteHandlerPayloadByType,\n type InstantRouteHandlerType,\n type InstantRouteHandlerBody,\n OAuthHandler,\n InstantOAuthError,\n generateSchemaTypescriptFile,\n collectSystemCatalogIdentNames,\n validateSchema,\n SchemaValidationError,\n generatePermsTypescriptFile,\n permsTypescriptFileToCode,\n apiSchemaToInstantSchemaDef,\n schemaTypescriptFileToInstantSchema,\n version,\n translatePlanSteps,\n PlatformApi,\n ProgressPromise,\n exchangeCodeForToken,\n exchangeRefreshToken,\n clerkDomainFromPublishableKey,\n i,\n Webhooks,\n WebhooksManager,\n type WebhookAction,\n type WebhookStatus,\n type WebhookEventStatus,\n type WebhookInfo,\n type WebhookAttempt,\n type WebhookEventInfo,\n type WebhookEventsPage,\n type WebhookBody,\n type WebhookEntity,\n type WebhookPayload,\n type WebhookPayloadRecord,\n type WebhookPayloadRecordFor,\n type WebhookHandlerFn,\n type WebhookHandlers,\n type WebhookHelpers,\n type CreateWebhookParams,\n type UpdateWebhookParams,\n};\n\nexport {\n diffSchemas,\n convertTxSteps,\n isRenamePromptItem,\n buildAutoRenameSelector,\n type RenameResolveFn,\n type MigrationTx,\n type MigrationTxSpecific,\n type MigrationTxTypes,\n type Identifier,\n} from './migrations.ts';\n\nexport {\n BackupsManager,\n backupZipName,\n estimateZipSize,\n formatFileSize,\n toAppBackup,\n type AppBackup,\n type AppBackupFile,\n type AppBackupStorageFile,\n} from './backups.ts';\n\nexport {\n type DownloadBackupArchiveOpts,\n type BackupArchiveWriter,\n type BackupDownloadProgress,\n type BackupDownloadResult,\n} from './backupDownload.ts';\n\nexport {\n oauthCallbackURL,\n GOOGLE_AUTHORIZATION_ENDPOINT,\n GOOGLE_DISCOVERY_ENDPOINT,\n GOOGLE_TOKEN_ENDPOINT,\n APPLE_AUTHORIZATION_ENDPOINT,\n APPLE_DISCOVERY_ENDPOINT,\n APPLE_TOKEN_ENDPOINT,\n LINKEDIN_AUTHORIZATION_ENDPOINT,\n LINKEDIN_DISCOVERY_ENDPOINT,\n LINKEDIN_TOKEN_ENDPOINT,\n} from './consts.ts';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AnyBlob, AnyLink, MigrationTx } from './migrations.ts';
|
|
2
|
+
export declare const attrDefToNewAttrTx: (attrInSchema: AnyBlob, entityName: string, createdName: string) => MigrationTx;
|
|
3
|
+
export declare const linkDefToNewAttrTx: (link: AnyLink) => MigrationTx;
|
|
4
|
+
//# sourceMappingURL=migrationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrationUtils.d.ts","sourceRoot":"","sources":["../../src/migrationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGhE,eAAO,MAAM,kBAAkB,GAC7B,cAAc,OAAO,EACrB,YAAY,MAAM,EAClB,aAAa,MAAM,KAClB,WAmBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,OAAO,KAAG,WA2BlD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.linkDefToNewAttrTx = exports.attrDefToNewAttrTx = void 0;
|
|
4
|
+
const relationships_ts_1 = require("./relationships.js");
|
|
5
|
+
const attrDefToNewAttrTx = (attrInSchema, entityName, createdName) => {
|
|
6
|
+
return {
|
|
7
|
+
type: 'add-attr',
|
|
8
|
+
'unique?': attrInSchema.config.unique,
|
|
9
|
+
'value-type': 'blob',
|
|
10
|
+
cardinality: 'one',
|
|
11
|
+
identifier: {
|
|
12
|
+
namespace: entityName,
|
|
13
|
+
attrName: createdName,
|
|
14
|
+
},
|
|
15
|
+
'required?': attrInSchema.required,
|
|
16
|
+
'forward-identity': {
|
|
17
|
+
attrName: createdName,
|
|
18
|
+
namespace: entityName,
|
|
19
|
+
},
|
|
20
|
+
'index?': attrInSchema.config.indexed,
|
|
21
|
+
'checked-data-type': attrInSchema.valueType !== 'json' ? attrInSchema.valueType : null,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.attrDefToNewAttrTx = attrDefToNewAttrTx;
|
|
25
|
+
const linkDefToNewAttrTx = (link) => {
|
|
26
|
+
const relationship = `${link.forward.has}-${link.reverse.has}`;
|
|
27
|
+
const uniqueAndCardinality = relationships_ts_1.relationshipConstraints[relationship];
|
|
28
|
+
return {
|
|
29
|
+
'checked-data-type': null,
|
|
30
|
+
'index?': false,
|
|
31
|
+
...uniqueAndCardinality,
|
|
32
|
+
'required?': !!link.forward.required,
|
|
33
|
+
identifier: {
|
|
34
|
+
attrName: link.forward.label,
|
|
35
|
+
namespace: link.forward.on,
|
|
36
|
+
},
|
|
37
|
+
'value-type': 'ref',
|
|
38
|
+
type: 'add-attr',
|
|
39
|
+
'forward-identity': {
|
|
40
|
+
attrName: link.forward.label,
|
|
41
|
+
namespace: link.forward.on,
|
|
42
|
+
},
|
|
43
|
+
'on-delete': link.forward.onDelete,
|
|
44
|
+
'on-delete-reverse': link.reverse.onDelete,
|
|
45
|
+
'reverse-identity': {
|
|
46
|
+
attrName: link.reverse.label,
|
|
47
|
+
namespace: link.reverse.on,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.linkDefToNewAttrTx = linkDefToNewAttrTx;
|
|
52
|
+
//# sourceMappingURL=migrationUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrationUtils.js","sourceRoot":"","sources":["../../src/migrationUtils.ts"],"names":[],"mappings":";;;AACA,yDAAgF;AAEzE,MAAM,kBAAkB,GAAG,CAChC,YAAqB,EACrB,UAAkB,EAClB,WAAmB,EACN,EAAE;IACf,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM;QACrC,YAAY,EAAE,MAAM;QACpB,WAAW,EAAE,KAAK;QAClB,UAAU,EAAE;YACV,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE,WAAW;SACtB;QACD,WAAW,EAAE,YAAY,CAAC,QAAQ;QAClC,kBAAkB,EAAE;YAClB,QAAQ,EAAE,WAAW;YACrB,SAAS,EAAE,UAAU;SACtB;QACD,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,OAAO;QACrC,mBAAmB,EACjB,YAAY,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;KACpE,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,kBAAkB,sBAuB7B;AAEK,MAAM,kBAAkB,GAAG,CAAC,IAAa,EAAe,EAAE;IAC/D,MAAM,YAAY,GAChB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAuB,CAAC;IACjE,MAAM,oBAAoB,GAAG,0CAAuB,CAAC,YAAY,CAAC,CAAC;IAEnE,OAAO;QACL,mBAAmB,EAAE,IAAI;QACzB,QAAQ,EAAE,KAAK;QACf,GAAG,oBAAoB;QACvB,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ;QACpC,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YAC5B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SAC3B;QACD,YAAY,EAAE,KAAK;QACnB,IAAI,EAAE,UAAU;QAChB,kBAAkB,EAAE;YAClB,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YAC5B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SAC3B;QACD,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;QAClC,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;QAC1C,kBAAkB,EAAE;YAClB,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YAC5B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SAC3B;KACF,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B","sourcesContent":["import { AnyBlob, AnyLink, MigrationTx } from './migrations.ts';\nimport { relationshipConstraints, RelationshipKinds } from './relationships.ts';\n\nexport const attrDefToNewAttrTx = (\n attrInSchema: AnyBlob,\n entityName: string,\n createdName: string,\n): MigrationTx => {\n return {\n type: 'add-attr',\n 'unique?': attrInSchema.config.unique,\n 'value-type': 'blob',\n cardinality: 'one',\n identifier: {\n namespace: entityName,\n attrName: createdName,\n },\n 'required?': attrInSchema.required,\n 'forward-identity': {\n attrName: createdName,\n namespace: entityName,\n },\n 'index?': attrInSchema.config.indexed,\n 'checked-data-type':\n attrInSchema.valueType !== 'json' ? attrInSchema.valueType : null,\n };\n};\n\nexport const linkDefToNewAttrTx = (link: AnyLink): MigrationTx => {\n const relationship =\n `${link.forward.has}-${link.reverse.has}` as RelationshipKinds;\n const uniqueAndCardinality = relationshipConstraints[relationship];\n\n return {\n 'checked-data-type': null,\n 'index?': false,\n ...uniqueAndCardinality,\n 'required?': !!link.forward.required,\n identifier: {\n attrName: link.forward.label,\n namespace: link.forward.on,\n },\n 'value-type': 'ref',\n type: 'add-attr',\n 'forward-identity': {\n attrName: link.forward.label,\n namespace: link.forward.on,\n },\n 'on-delete': link.forward.onDelete,\n 'on-delete-reverse': link.reverse.onDelete,\n 'reverse-identity': {\n attrName: link.reverse.label,\n namespace: link.reverse.on,\n },\n };\n};\n"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { DataAttrDef, InstantDBAttr, InstantDBAttrOnDelete, InstantDBCheckedDataType, InstantSchemaDef, LinkDef } from '@sidekickdb/core';
|
|
2
|
+
import { PlanStep } from './api.ts';
|
|
3
|
+
export type Identifier = {
|
|
4
|
+
namespace: string;
|
|
5
|
+
attrName: string;
|
|
6
|
+
};
|
|
7
|
+
type AttrWithIdentifier = {
|
|
8
|
+
'value-type': 'blob' | 'ref';
|
|
9
|
+
cardinality?: 'many' | 'one';
|
|
10
|
+
'forward-identity'?: Identifier;
|
|
11
|
+
'reverse-identity'?: Identifier | null;
|
|
12
|
+
'on-delete'?: InstantDBAttrOnDelete | null | undefined;
|
|
13
|
+
'on-delete-reverse'?: InstantDBAttrOnDelete | null | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type MigrationTxTypes = {
|
|
16
|
+
'delete-attr': {
|
|
17
|
+
identifier: Identifier;
|
|
18
|
+
};
|
|
19
|
+
'update-attr': {
|
|
20
|
+
identifier: Identifier;
|
|
21
|
+
partialAttr: AttrWithIdentifier;
|
|
22
|
+
};
|
|
23
|
+
'add-attr': {
|
|
24
|
+
identifier: Identifier;
|
|
25
|
+
'unique?': boolean;
|
|
26
|
+
'index?': boolean;
|
|
27
|
+
'required?': boolean;
|
|
28
|
+
'reverse-identity'?: Identifier | null;
|
|
29
|
+
'forward-identity': Identifier;
|
|
30
|
+
cardinality: 'many' | 'one';
|
|
31
|
+
'value-type': 'blob' | 'ref';
|
|
32
|
+
'on-delete'?: InstantDBAttrOnDelete | null;
|
|
33
|
+
'on-delete-reverse'?: InstantDBAttrOnDelete | null;
|
|
34
|
+
'checked-data-type'?: InstantDBCheckedDataType | null;
|
|
35
|
+
};
|
|
36
|
+
index: {
|
|
37
|
+
identifier: Identifier;
|
|
38
|
+
};
|
|
39
|
+
'remove-index': {
|
|
40
|
+
identifier: Identifier;
|
|
41
|
+
};
|
|
42
|
+
unique: {
|
|
43
|
+
identifier: Identifier;
|
|
44
|
+
};
|
|
45
|
+
'remove-unique': {
|
|
46
|
+
identifier: Identifier;
|
|
47
|
+
};
|
|
48
|
+
required: {
|
|
49
|
+
identifier: Identifier;
|
|
50
|
+
};
|
|
51
|
+
'remove-required': {
|
|
52
|
+
identifier: Identifier;
|
|
53
|
+
};
|
|
54
|
+
'check-data-type': {
|
|
55
|
+
identifier: Identifier;
|
|
56
|
+
'checked-data-type': InstantDBCheckedDataType;
|
|
57
|
+
};
|
|
58
|
+
'remove-data-type': {
|
|
59
|
+
identifier: Identifier;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const convertTxSteps: (txs: MigrationTx[], existingAttrs: InstantDBAttr[]) => PlanStep[];
|
|
63
|
+
export type MigrationTx = {
|
|
64
|
+
[K in keyof MigrationTxTypes]: {
|
|
65
|
+
type: K;
|
|
66
|
+
} & MigrationTxTypes[K];
|
|
67
|
+
}[keyof MigrationTxTypes];
|
|
68
|
+
export type MigrationTxSpecific<T extends keyof MigrationTxTypes> = {
|
|
69
|
+
type: T;
|
|
70
|
+
} & MigrationTxTypes[T];
|
|
71
|
+
export type AnyLink = LinkDef<any, any, any, any, any, any, any>;
|
|
72
|
+
export type AnyBlob = DataAttrDef<any, any, any>;
|
|
73
|
+
export declare const diffSchemas: (oldSchema: InstantSchemaDef<any, any, any>, newSchema: InstantSchemaDef<any, any, any>, resolveFn: RenameResolveFn<string>, systemCatalogIdentNames: Record<string, Set<string>>) => Promise<MigrationTx[]>;
|
|
74
|
+
export interface RenamePromptItem<T> {
|
|
75
|
+
from: T;
|
|
76
|
+
to: T;
|
|
77
|
+
}
|
|
78
|
+
export declare const compareBlobs: (identity: Identifier, oldBlob: AnyBlob, newBlob: AnyBlob) => MigrationTx[];
|
|
79
|
+
export declare const compareLinks: (identity: Identifier, oldLink: AnyLink, newLink: AnyLink) => MigrationTx[];
|
|
80
|
+
export declare const isRenamePromptItem: <T>(item: RenamePromptItem<T> | T) => item is RenamePromptItem<T>;
|
|
81
|
+
export type RenameResolveFn<T> = (created: T, promptData: (RenamePromptItem<T> | T)[], extraInfo?: any) => Promise<T | RenamePromptItem<T>>;
|
|
82
|
+
/**
|
|
83
|
+
* a `rename command` lets us know your intent to rename a particular entity
|
|
84
|
+
*
|
|
85
|
+
* The format is `from:to`, where `from` and `to` are lookups.
|
|
86
|
+
*
|
|
87
|
+
* For example, to rename `posts.name` to `posts.title`, a command could
|
|
88
|
+
* look like:
|
|
89
|
+
*
|
|
90
|
+
* `posts.name:posts.title`
|
|
91
|
+
*/
|
|
92
|
+
export type RenameCommand = `${string}.${string}:${string}.${string}`;
|
|
93
|
+
/**
|
|
94
|
+
* Given a list of RenameCommands, builds a cusotm `resolveFn` for
|
|
95
|
+
* `diffSchemas`, which automatically resolves rename conflicts with these commands.
|
|
96
|
+
*/
|
|
97
|
+
export declare function buildAutoRenameSelector(renames: RenameCommand[]): RenameResolveFn<string>;
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,OAAO,EACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIpC,MAAM,MA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