@inlang/sdk 0.36.4 → 2.0.0-beta.1
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 +1 -1
- package/dist/database/initDb.d.ts +7 -0
- package/dist/database/initDb.d.ts.map +1 -0
- package/dist/database/initDb.js +36 -0
- package/dist/database/initDb.js.map +1 -0
- package/dist/database/initDbAndSchema.test.d.ts +2 -0
- package/dist/database/initDbAndSchema.test.d.ts.map +1 -0
- package/dist/database/initDbAndSchema.test.js +110 -0
- package/dist/database/initDbAndSchema.test.js.map +1 -0
- package/dist/database/jsonbPlugin.d.ts +20 -0
- package/dist/database/jsonbPlugin.d.ts.map +1 -0
- package/dist/database/jsonbPlugin.js +183 -0
- package/dist/database/jsonbPlugin.js.map +1 -0
- package/dist/database/jsonbPlugin.test.d.ts +2 -0
- package/dist/database/jsonbPlugin.test.d.ts.map +1 -0
- package/dist/database/jsonbPlugin.test.js +119 -0
- package/dist/database/jsonbPlugin.test.js.map +1 -0
- package/dist/database/schema.d.ts +74 -0
- package/dist/database/schema.d.ts.map +1 -0
- package/dist/database/schema.js +45 -0
- package/dist/database/schema.js.map +1 -0
- package/dist/helper.d.ts +71 -0
- package/dist/helper.d.ts.map +1 -0
- package/dist/helper.js +91 -0
- package/dist/helper.js.map +1 -0
- package/dist/human-id/human-id.d.ts +3 -0
- package/dist/human-id/human-id.d.ts.map +1 -0
- package/dist/human-id/human-id.js +12 -0
- package/dist/human-id/human-id.js.map +1 -0
- package/dist/human-id/words.d.ts.map +1 -0
- package/dist/{storage/human-id → human-id}/words.js +4 -0
- package/dist/human-id/words.js.map +1 -0
- package/dist/human-id/words.test.d.ts.map +1 -0
- package/dist/{storage/human-id → human-id}/words.test.js +4 -0
- package/dist/human-id/words.test.js.map +1 -0
- package/dist/import-export/exportFiles.d.ts +11 -0
- package/dist/import-export/exportFiles.d.ts.map +1 -0
- package/dist/import-export/exportFiles.js +26 -0
- package/dist/import-export/exportFiles.js.map +1 -0
- package/dist/import-export/importFiles.d.ts +13 -0
- package/dist/import-export/importFiles.d.ts.map +1 -0
- package/dist/import-export/importFiles.js +124 -0
- package/dist/import-export/importFiles.js.map +1 -0
- package/dist/import-export/importFiles.test.d.ts +2 -0
- package/dist/import-export/importFiles.test.d.ts.map +1 -0
- package/dist/import-export/importFiles.test.js +179 -0
- package/dist/import-export/importFiles.test.js.map +1 -0
- package/dist/import-export/roundtrip.test.d.ts +2 -0
- package/dist/import-export/roundtrip.test.d.ts.map +1 -0
- package/dist/import-export/roundtrip.test.js +273 -0
- package/dist/import-export/roundtrip.test.js.map +1 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.d.ts +4 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.d.ts.map +1 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.js +58 -0
- package/dist/import-export/upsertBundleNestedMatchByProperties.js.map +1 -0
- package/dist/index.d.ts +21 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -17
- package/dist/index.js.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.d.ts +9 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.js +84 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.js.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.d.ts +2 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.js +85 -0
- package/dist/json-schema/old-v1-message/fromMessageV1.test.js.map +1 -0
- package/dist/json-schema/old-v1-message/schemaV1.d.ts +86 -0
- package/dist/json-schema/old-v1-message/schemaV1.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/schemaV1.js +35 -0
- package/dist/json-schema/old-v1-message/schemaV1.js.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.d.ts +9 -0
- package/dist/json-schema/old-v1-message/toMessageV1.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.js +67 -0
- package/dist/json-schema/old-v1-message/toMessageV1.js.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.d.ts +2 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.d.ts.map +1 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.js +85 -0
- package/dist/json-schema/old-v1-message/toMessageV1.test.js.map +1 -0
- package/dist/json-schema/pattern.d.ts +190 -0
- package/dist/json-schema/pattern.d.ts.map +1 -0
- package/dist/json-schema/pattern.js +43 -0
- package/dist/json-schema/pattern.js.map +1 -0
- package/dist/json-schema/settings.d.ts +31 -0
- package/dist/json-schema/settings.d.ts.map +1 -0
- package/dist/json-schema/settings.js +96 -0
- package/dist/json-schema/settings.js.map +1 -0
- package/dist/json-schema/settings.test-d.d.ts +2 -0
- package/dist/json-schema/settings.test-d.d.ts.map +1 -0
- package/dist/json-schema/settings.test-d.js +20 -0
- package/dist/json-schema/settings.test-d.js.map +1 -0
- package/dist/lix-plugin/applyChanges.d.ts +3 -0
- package/dist/lix-plugin/applyChanges.d.ts.map +1 -0
- package/dist/lix-plugin/applyChanges.js +127 -0
- package/dist/lix-plugin/applyChanges.js.map +1 -0
- package/dist/lix-plugin/applyChanges.test.d.ts +2 -0
- package/dist/lix-plugin/applyChanges.test.d.ts.map +1 -0
- package/dist/lix-plugin/applyChanges.test.js +135 -0
- package/dist/lix-plugin/applyChanges.test.js.map +1 -0
- package/dist/lix-plugin/detectConflicts.d.ts +3 -0
- package/dist/lix-plugin/detectConflicts.d.ts.map +1 -0
- package/dist/lix-plugin/detectConflicts.js +47 -0
- package/dist/lix-plugin/detectConflicts.js.map +1 -0
- package/dist/lix-plugin/detectConflicts.test.d.ts +2 -0
- package/dist/lix-plugin/detectConflicts.test.d.ts.map +1 -0
- package/dist/lix-plugin/detectConflicts.test.js +251 -0
- package/dist/lix-plugin/detectConflicts.test.js.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.d.ts +8 -0
- package/dist/lix-plugin/inlangLixPluginV1.d.ts.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.js +109 -0
- package/dist/lix-plugin/inlangLixPluginV1.js.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.d.ts +2 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.d.ts.map +1 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.js +418 -0
- package/dist/lix-plugin/inlangLixPluginV1.test.js.map +1 -0
- package/dist/lix-plugin/merge.test.d.ts +2 -0
- package/dist/lix-plugin/merge.test.d.ts.map +1 -0
- package/dist/lix-plugin/merge.test.js +120 -0
- package/dist/lix-plugin/merge.test.js.map +1 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.d.ts +2 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.d.ts.map +1 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.js +176 -0
- package/dist/lix-plugin/resolveConflictBySelecting.test.js.map +1 -0
- package/dist/migrations/v2/createMessageV1.d.ts +28 -0
- package/dist/migrations/v2/createMessageV1.d.ts.map +1 -0
- package/dist/migrations/v2/createMessageV1.js +31 -0
- package/dist/migrations/v2/createMessageV1.js.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.d.ts +9 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.d.ts.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.js +31 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.js.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.d.ts +2 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.d.ts.map +1 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.js +45 -0
- package/dist/migrations/v2/withLanguageTagToLocaleMigration.test.js.map +1 -0
- package/dist/plugin/cache.d.ts +6 -0
- package/dist/plugin/cache.d.ts.map +1 -0
- package/dist/plugin/cache.js +59 -0
- package/dist/plugin/cache.js.map +1 -0
- package/dist/plugin/cache.test.d.ts +2 -0
- package/dist/plugin/cache.test.d.ts.map +1 -0
- package/dist/plugin/cache.test.js +61 -0
- package/dist/plugin/cache.test.js.map +1 -0
- package/dist/plugin/errors.d.ts +41 -0
- package/dist/plugin/errors.d.ts.map +1 -0
- package/dist/plugin/errors.js +48 -0
- package/dist/plugin/errors.js.map +1 -0
- package/dist/plugin/importPlugins.d.ts +19 -0
- package/dist/plugin/importPlugins.d.ts.map +1 -0
- package/dist/plugin/importPlugins.js +43 -0
- package/dist/plugin/importPlugins.js.map +1 -0
- package/dist/plugin/importPlugins.test.d.ts +2 -0
- package/dist/plugin/importPlugins.test.d.ts.map +1 -0
- package/dist/plugin/importPlugins.test.js +95 -0
- package/dist/plugin/importPlugins.test.js.map +1 -0
- package/dist/plugin/meta/ideExtension.d.ts +54 -0
- package/dist/plugin/meta/ideExtension.d.ts.map +1 -0
- package/dist/plugin/meta/ideExtension.js +5 -0
- package/dist/plugin/meta/ideExtension.js.map +1 -0
- package/dist/plugin/schema.d.ts +152 -0
- package/dist/plugin/schema.d.ts.map +1 -0
- package/dist/plugin/schema.js +5 -0
- package/dist/plugin/schema.js.map +1 -0
- package/dist/project/api.d.ts +74 -0
- package/dist/project/api.d.ts.map +1 -0
- package/dist/project/api.js +5 -0
- package/dist/project/api.js.map +1 -0
- package/dist/project/initHandleSaveToLixOnChange.d.ts +14 -0
- package/dist/project/initHandleSaveToLixOnChange.d.ts.map +1 -0
- package/dist/project/initHandleSaveToLixOnChange.js +87 -0
- package/dist/project/initHandleSaveToLixOnChange.js.map +1 -0
- package/dist/project/loadProject.d.ts +53 -0
- package/dist/project/loadProject.d.ts.map +1 -0
- package/dist/project/loadProject.js +167 -0
- package/dist/project/loadProject.js.map +1 -0
- package/dist/project/loadProject.test.d.ts.map +1 -0
- package/dist/project/loadProject.test.js +146 -0
- package/dist/project/loadProject.test.js.map +1 -0
- package/dist/project/loadProjectFromDirectory.d.ts +77 -0
- package/dist/project/loadProjectFromDirectory.d.ts.map +1 -0
- package/dist/project/loadProjectFromDirectory.js +584 -0
- package/dist/project/loadProjectFromDirectory.js.map +1 -0
- package/dist/project/loadProjectFromDirectory.test.d.ts +2 -0
- package/dist/project/loadProjectFromDirectory.test.d.ts.map +1 -0
- package/dist/project/loadProjectFromDirectory.test.js +663 -0
- package/dist/project/loadProjectFromDirectory.test.js.map +1 -0
- package/dist/project/loadProjectInMemory.d.ts +8 -0
- package/dist/project/loadProjectInMemory.d.ts.map +1 -0
- package/dist/project/loadProjectInMemory.js +32 -0
- package/dist/project/loadProjectInMemory.js.map +1 -0
- package/dist/project/loadProjectInMemory.test.d.ts +2 -0
- package/dist/project/loadProjectInMemory.test.d.ts.map +1 -0
- package/dist/project/loadProjectInMemory.test.js +27 -0
- package/dist/project/loadProjectInMemory.test.js.map +1 -0
- package/dist/project/maybeCaptureTelemetry.d.ts +13 -0
- package/dist/project/maybeCaptureTelemetry.d.ts.map +1 -0
- package/dist/project/maybeCaptureTelemetry.js +53 -0
- package/dist/project/maybeCaptureTelemetry.js.map +1 -0
- package/dist/project/maybeCaptureTelemetry.test.d.ts +2 -0
- package/dist/project/maybeCaptureTelemetry.test.d.ts.map +1 -0
- package/dist/project/maybeCaptureTelemetry.test.js +65 -0
- package/dist/project/maybeCaptureTelemetry.test.js.map +1 -0
- package/dist/project/newProject.d.ts +17 -0
- package/dist/project/newProject.d.ts.map +1 -0
- package/dist/project/newProject.js +71 -0
- package/dist/project/newProject.js.map +1 -0
- package/dist/project/newProject.test.d.ts +2 -0
- package/dist/project/newProject.test.d.ts.map +1 -0
- package/dist/project/newProject.test.js +37 -0
- package/dist/project/newProject.test.js.map +1 -0
- package/dist/project/saveProjectToDirectory.d.ts +8 -0
- package/dist/project/saveProjectToDirectory.d.ts.map +1 -0
- package/dist/project/saveProjectToDirectory.js +86 -0
- package/dist/project/saveProjectToDirectory.js.map +1 -0
- package/dist/project/saveProjectToDirectory.test.d.ts +2 -0
- package/dist/project/saveProjectToDirectory.test.d.ts.map +1 -0
- package/dist/project/saveProjectToDirectory.test.js +245 -0
- package/dist/project/saveProjectToDirectory.test.js.map +1 -0
- package/dist/project/state/id$.d.ts +6 -0
- package/dist/project/state/id$.d.ts.map +1 -0
- package/dist/project/state/id$.js +19 -0
- package/dist/project/state/id$.js.map +1 -0
- package/dist/project/state/id$.test.d.ts +2 -0
- package/dist/project/state/id$.test.d.ts.map +1 -0
- package/dist/project/state/id$.test.js +36 -0
- package/dist/project/state/id$.test.js.map +1 -0
- package/dist/project/state/setSettings.d.ts +7 -0
- package/dist/project/state/setSettings.d.ts.map +1 -0
- package/dist/project/state/setSettings.js +16 -0
- package/dist/project/state/setSettings.js.map +1 -0
- package/dist/project/state/setSettings.test.d.ts +2 -0
- package/dist/project/state/setSettings.test.d.ts.map +1 -0
- package/dist/project/state/setSettings.test.js +58 -0
- package/dist/project/state/setSettings.test.js.map +1 -0
- package/dist/project/state/settings$.d.ts +7 -0
- package/dist/project/state/settings$.d.ts.map +1 -0
- package/dist/project/state/settings$.js +21 -0
- package/dist/project/state/settings$.js.map +1 -0
- package/dist/project/state/settings$.test.d.ts +2 -0
- package/dist/project/state/settings$.test.d.ts.map +1 -0
- package/dist/project/state/settings$.test.js +51 -0
- package/dist/project/state/settings$.test.js.map +1 -0
- package/dist/project/state/state.d.ts +58 -0
- package/dist/project/state/state.d.ts.map +1 -0
- package/dist/project/state/state.js +67 -0
- package/dist/project/state/state.js.map +1 -0
- package/dist/project/state/state.test.d.ts +2 -0
- package/dist/project/state/state.test.d.ts.map +1 -0
- package/dist/project/state/state.test.js +103 -0
- package/dist/project/state/state.test.js.map +1 -0
- package/dist/query-utilities/index.d.ts +5 -0
- package/dist/query-utilities/index.d.ts.map +1 -0
- package/dist/query-utilities/index.js +8 -0
- package/dist/query-utilities/index.js.map +1 -0
- package/dist/query-utilities/insertBundleNested.d.ts +4 -0
- package/dist/query-utilities/insertBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/insertBundleNested.js +39 -0
- package/dist/query-utilities/insertBundleNested.js.map +1 -0
- package/dist/query-utilities/pollQuery.d.ts +14 -0
- package/dist/query-utilities/pollQuery.d.ts.map +1 -0
- package/dist/query-utilities/pollQuery.js +22 -0
- package/dist/query-utilities/pollQuery.js.map +1 -0
- package/dist/query-utilities/pollQuery.test.d.ts +2 -0
- package/dist/query-utilities/pollQuery.test.d.ts.map +1 -0
- package/dist/query-utilities/pollQuery.test.js +67 -0
- package/dist/query-utilities/pollQuery.test.js.map +1 -0
- package/dist/query-utilities/selectBundleNested.d.ts +107 -0
- package/dist/query-utilities/selectBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/selectBundleNested.js +43 -0
- package/dist/query-utilities/selectBundleNested.js.map +1 -0
- package/dist/query-utilities/updateBundleNested.d.ts +12 -0
- package/dist/query-utilities/updateBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/updateBundleNested.js +25 -0
- package/dist/query-utilities/updateBundleNested.js.map +1 -0
- package/dist/query-utilities/upsertBundleNested.d.ts +4 -0
- package/dist/query-utilities/upsertBundleNested.d.ts.map +1 -0
- package/dist/query-utilities/upsertBundleNested.js +50 -0
- package/dist/query-utilities/upsertBundleNested.js.map +1 -0
- package/dist/services/env-variables/index.d.ts +6 -0
- package/dist/services/env-variables/index.d.ts.map +1 -0
- package/dist/services/env-variables/index.js +9 -0
- package/dist/services/env-variables/index.js.map +1 -0
- package/dist/services/error-reporting/index.d.ts +15 -0
- package/dist/services/error-reporting/index.d.ts.map +1 -0
- package/dist/services/error-reporting/index.js +30 -0
- package/dist/services/error-reporting/index.js.map +1 -0
- package/dist/{telemetry → services/telemetry}/capture.d.ts +4 -2
- package/dist/services/telemetry/capture.d.ts.map +1 -0
- package/dist/services/telemetry/capture.js +77 -0
- package/dist/services/telemetry/capture.js.map +1 -0
- package/dist/services/telemetry/capture.test.d.ts +2 -0
- package/dist/services/telemetry/capture.test.d.ts.map +1 -0
- package/dist/services/telemetry/capture.test.js +44 -0
- package/dist/services/telemetry/capture.test.js.map +1 -0
- package/dist/utilities/detectJsonFormatting.d.ts +11 -0
- package/dist/utilities/detectJsonFormatting.d.ts.map +1 -0
- package/dist/utilities/detectJsonFormatting.js +83 -0
- package/dist/utilities/detectJsonFormatting.js.map +1 -0
- package/dist/utilities/detectJsonFormatting.test.d.ts +2 -0
- package/dist/utilities/detectJsonFormatting.test.d.ts.map +1 -0
- package/dist/utilities/detectJsonFormatting.test.js +33 -0
- package/dist/utilities/detectJsonFormatting.test.js.map +1 -0
- package/package.json +32 -40
- package/src/database/initDb.ts +34 -0
- package/src/database/initDbAndSchema.test.ts +125 -0
- package/src/database/jsonbPlugin.test.ts +154 -0
- package/src/database/jsonbPlugin.ts +215 -0
- package/src/database/schema.ts +127 -0
- package/src/helper.ts +113 -0
- package/src/human-id/human-id.ts +14 -0
- package/src/{storage/human-id → human-id}/words.test.ts +14 -14
- package/src/{storage/human-id → human-id}/words.ts +4 -4
- package/src/import-export/exportFiles.ts +36 -0
- package/src/import-export/importFiles.test.ts +211 -0
- package/src/import-export/importFiles.ts +142 -0
- package/src/import-export/roundtrip.test.ts +313 -0
- package/src/import-export/upsertBundleNestedMatchByProperties.ts +74 -0
- package/src/index.ts +29 -37
- package/src/json-schema/old-v1-message/README.md +1 -0
- package/src/json-schema/old-v1-message/fromMessageV1.test.ts +87 -0
- package/src/json-schema/old-v1-message/fromMessageV1.ts +99 -0
- package/src/json-schema/old-v1-message/schemaV1.ts +66 -0
- package/src/json-schema/old-v1-message/toMessageV1.test.ts +87 -0
- package/src/json-schema/old-v1-message/toMessageV1.ts +79 -0
- package/src/json-schema/pattern.ts +59 -0
- package/src/json-schema/settings.test-d.ts +21 -0
- package/src/json-schema/settings.ts +138 -0
- package/src/lix-plugin/applyChanges.test.ts +150 -0
- package/src/lix-plugin/applyChanges.ts +171 -0
- package/src/lix-plugin/detectConflicts.test.ts +286 -0
- package/src/lix-plugin/detectConflicts.ts +62 -0
- package/src/lix-plugin/inlangLixPluginV1.test.ts +439 -0
- package/src/lix-plugin/inlangLixPluginV1.ts +132 -0
- package/src/lix-plugin/merge.test.ts +133 -0
- package/src/lix-plugin/resolveConflictBySelecting.test.ts +188 -0
- package/src/migrations/v2/createMessageV1.ts +37 -0
- package/src/migrations/v2/withLanguageTagToLocaleMigration.test.ts +51 -0
- package/src/migrations/v2/withLanguageTagToLocaleMigration.ts +31 -0
- package/src/plugin/cache.test.ts +83 -0
- package/src/plugin/cache.ts +79 -0
- package/src/plugin/errors.ts +67 -0
- package/src/plugin/importPlugins.test.ts +107 -0
- package/src/plugin/importPlugins.ts +60 -0
- package/src/plugin/meta/ideExtension.ts +56 -0
- package/src/plugin/schema.ts +165 -0
- package/src/project/api.ts +77 -0
- package/src/project/initHandleSaveToLixOnChange.ts +93 -0
- package/src/project/loadProject.test.ts +177 -0
- package/src/project/loadProject.ts +245 -0
- package/src/project/loadProjectFromDirectory.test.ts +854 -0
- package/src/project/loadProjectFromDirectory.ts +752 -0
- package/src/project/loadProjectInMemory.test.ts +29 -0
- package/src/project/loadProjectInMemory.ts +36 -0
- package/src/project/maybeCaptureTelemetry.test.ts +72 -0
- package/src/project/maybeCaptureTelemetry.ts +61 -0
- package/src/project/newProject.test.ts +36 -0
- package/src/project/newProject.ts +78 -0
- package/src/project/saveProjectToDirectory.test.ts +310 -0
- package/src/project/saveProjectToDirectory.ts +100 -0
- package/src/query-utilities/index.ts +4 -0
- package/src/query-utilities/insertBundleNested.ts +46 -0
- package/src/query-utilities/selectBundleNested.ts +46 -0
- package/src/query-utilities/updateBundleNested.ts +35 -0
- package/src/query-utilities/upsertBundleNested.ts +61 -0
- package/src/services/env-variables/createIndexFile.js +40 -0
- package/src/{env-variables → services/env-variables}/index.d.ts +8 -5
- package/src/services/error-reporting/index.ts +28 -0
- package/src/services/telemetry/capture.test.ts +48 -0
- package/src/services/telemetry/capture.ts +98 -0
- package/src/utilities/detectJsonFormatting.test.ts +38 -0
- package/src/utilities/detectJsonFormatting.ts +109 -0
- package/dist/adapter/solidAdapter.d.ts +0 -33
- package/dist/adapter/solidAdapter.d.ts.map +0 -1
- package/dist/adapter/solidAdapter.js +0 -40
- package/dist/adapter/solidAdapter.test.d.ts +0 -2
- package/dist/adapter/solidAdapter.test.d.ts.map +0 -1
- package/dist/adapter/solidAdapter.test.js +0 -356
- package/dist/api.d.ts +0 -113
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -1
- package/dist/api.test-d.d.ts +0 -2
- package/dist/api.test-d.d.ts.map +0 -1
- package/dist/api.test-d.js +0 -4
- package/dist/createMessageLintReportsQuery.d.ts +0 -12
- package/dist/createMessageLintReportsQuery.d.ts.map +0 -1
- package/dist/createMessageLintReportsQuery.js +0 -176
- package/dist/createMessagesQuery.d.ts +0 -19
- package/dist/createMessagesQuery.d.ts.map +0 -1
- package/dist/createMessagesQuery.js +0 -451
- package/dist/createMessagesQuery.test.d.ts +0 -2
- package/dist/createMessagesQuery.test.d.ts.map +0 -1
- package/dist/createMessagesQuery.test.js +0 -402
- package/dist/createNewProject.d.ts +0 -12
- package/dist/createNewProject.d.ts.map +0 -1
- package/dist/createNewProject.js +0 -38
- package/dist/createNewProject.test.d.ts +0 -2
- package/dist/createNewProject.test.d.ts.map +0 -1
- package/dist/createNewProject.test.js +0 -91
- package/dist/createNodeishFsWithAbsolutePaths.d.ts +0 -12
- package/dist/createNodeishFsWithAbsolutePaths.d.ts.map +0 -1
- package/dist/createNodeishFsWithAbsolutePaths.js +0 -38
- package/dist/createNodeishFsWithAbsolutePaths.test.d.ts +0 -2
- package/dist/createNodeishFsWithAbsolutePaths.test.d.ts.map +0 -1
- package/dist/createNodeishFsWithAbsolutePaths.test.js +0 -44
- package/dist/createNodeishFsWithWatcher.d.ts +0 -14
- package/dist/createNodeishFsWithWatcher.d.ts.map +0 -1
- package/dist/createNodeishFsWithWatcher.js +0 -75
- package/dist/createNodeishFsWithWatcher.test.d.ts +0 -2
- package/dist/createNodeishFsWithWatcher.test.d.ts.map +0 -1
- package/dist/createNodeishFsWithWatcher.test.js +0 -38
- package/dist/defaultProjectSettings.d.ts +0 -14
- package/dist/defaultProjectSettings.d.ts.map +0 -1
- package/dist/defaultProjectSettings.js +0 -22
- package/dist/env-variables/index.d.ts +0 -4
- package/dist/env-variables/index.d.ts.map +0 -1
- package/dist/env-variables/index.js +0 -3
- package/dist/errors.d.ts +0 -48
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -62
- package/dist/lint/index.d.ts +0 -3
- package/dist/lint/index.d.ts.map +0 -1
- package/dist/lint/index.js +0 -2
- package/dist/lint/message/errors.d.ts +0 -7
- package/dist/lint/message/errors.d.ts.map +0 -1
- package/dist/lint/message/errors.js +0 -9
- package/dist/lint/message/lintMessages.d.ts +0 -13
- package/dist/lint/message/lintMessages.d.ts.map +0 -1
- package/dist/lint/message/lintMessages.js +0 -12
- package/dist/lint/message/lintMessages.test.d.ts +0 -2
- package/dist/lint/message/lintMessages.test.d.ts.map +0 -1
- package/dist/lint/message/lintMessages.test.js +0 -107
- package/dist/lint/message/lintSingleMessage.d.ts +0 -19
- package/dist/lint/message/lintSingleMessage.d.ts.map +0 -1
- package/dist/lint/message/lintSingleMessage.js +0 -38
- package/dist/lint/message/lintSingleMessage.test.d.ts +0 -2
- package/dist/lint/message/lintSingleMessage.test.d.ts.map +0 -1
- package/dist/lint/message/lintSingleMessage.test.js +0 -161
- package/dist/listProjects.d.ts +0 -5
- package/dist/listProjects.d.ts.map +0 -1
- package/dist/listProjects.js +0 -38
- package/dist/listProjects.test.d.ts +0 -2
- package/dist/listProjects.test.d.ts.map +0 -1
- package/dist/listProjects.test.js +0 -72
- package/dist/loadProject.d.ts +0 -19
- package/dist/loadProject.d.ts.map +0 -1
- package/dist/loadProject.js +0 -343
- package/dist/loadProject.test.d.ts.map +0 -1
- package/dist/loadProject.test.js +0 -975
- package/dist/messages/errors.d.ts +0 -13
- package/dist/messages/errors.d.ts.map +0 -1
- package/dist/messages/errors.js +0 -18
- package/dist/messages/index.d.ts +0 -3
- package/dist/messages/index.d.ts.map +0 -1
- package/dist/messages/index.js +0 -2
- package/dist/messages/variant.d.ts +0 -46
- package/dist/messages/variant.d.ts.map +0 -1
- package/dist/messages/variant.js +0 -176
- package/dist/messages/variant.test.d.ts +0 -2
- package/dist/messages/variant.test.d.ts.map +0 -1
- package/dist/messages/variant.test.js +0 -439
- package/dist/migrations/maybeAddModuleCache.d.ts +0 -6
- package/dist/migrations/maybeAddModuleCache.d.ts.map +0 -1
- package/dist/migrations/maybeAddModuleCache.js +0 -62
- package/dist/migrations/maybeCreateFirstProjectId.d.ts +0 -16
- package/dist/migrations/maybeCreateFirstProjectId.d.ts.map +0 -1
- package/dist/migrations/maybeCreateFirstProjectId.js +0 -46
- package/dist/migrations/maybeCreateFirstProjectId.test.d.ts +0 -2
- package/dist/migrations/maybeCreateFirstProjectId.test.d.ts.map +0 -1
- package/dist/migrations/maybeCreateFirstProjectId.test.js +0 -24
- package/dist/migrations/migrateToDirectory.d.ts +0 -10
- package/dist/migrations/migrateToDirectory.d.ts.map +0 -1
- package/dist/migrations/migrateToDirectory.js +0 -48
- package/dist/migrations/migrateToDirectory.test.d.ts +0 -2
- package/dist/migrations/migrateToDirectory.test.d.ts.map +0 -1
- package/dist/migrations/migrateToDirectory.test.js +0 -48
- package/dist/parseConfig.d.ts +0 -8
- package/dist/parseConfig.d.ts.map +0 -1
- package/dist/parseConfig.js +0 -26
- package/dist/persistence/batchedIO.d.ts +0 -11
- package/dist/persistence/batchedIO.d.ts.map +0 -1
- package/dist/persistence/batchedIO.js +0 -49
- package/dist/persistence/batchedIO.test.d.ts +0 -2
- package/dist/persistence/batchedIO.test.d.ts.map +0 -1
- package/dist/persistence/batchedIO.test.js +0 -56
- package/dist/persistence/filelock/acquireFileLock.d.ts +0 -3
- package/dist/persistence/filelock/acquireFileLock.d.ts.map +0 -1
- package/dist/persistence/filelock/acquireFileLock.js +0 -111
- package/dist/persistence/filelock/releaseLock.d.ts +0 -3
- package/dist/persistence/filelock/releaseLock.d.ts.map +0 -1
- package/dist/persistence/filelock/releaseLock.js +0 -24
- package/dist/persistence/store.d.ts +0 -107
- package/dist/persistence/store.d.ts.map +0 -1
- package/dist/persistence/store.js +0 -99
- package/dist/persistence/store.test.d.ts +0 -2
- package/dist/persistence/store.test.d.ts.map +0 -1
- package/dist/persistence/store.test.js +0 -79
- package/dist/persistence/storeApi.d.ts +0 -22
- package/dist/persistence/storeApi.d.ts.map +0 -1
- package/dist/persistence/storeApi.js +0 -1
- package/dist/reactivity/map.d.ts +0 -67
- package/dist/reactivity/map.d.ts.map +0 -1
- package/dist/reactivity/map.js +0 -143
- package/dist/reactivity/solid.d.ts +0 -14
- package/dist/reactivity/solid.d.ts.map +0 -1
- package/dist/reactivity/solid.js +0 -15
- package/dist/reactivity/solid.test.d.ts +0 -2
- package/dist/reactivity/solid.test.d.ts.map +0 -1
- package/dist/reactivity/solid.test.js +0 -189
- package/dist/reactivity/trigger.d.ts +0 -11
- package/dist/reactivity/trigger.d.ts.map +0 -1
- package/dist/reactivity/trigger.js +0 -46
- package/dist/resolve-modules/cache.d.ts +0 -6
- package/dist/resolve-modules/cache.d.ts.map +0 -1
- package/dist/resolve-modules/cache.js +0 -58
- package/dist/resolve-modules/errors.d.ts +0 -41
- package/dist/resolve-modules/errors.d.ts.map +0 -1
- package/dist/resolve-modules/errors.js +0 -45
- package/dist/resolve-modules/import.d.ts +0 -19
- package/dist/resolve-modules/import.d.ts.map +0 -1
- package/dist/resolve-modules/import.js +0 -102
- package/dist/resolve-modules/import.test.d.ts +0 -2
- package/dist/resolve-modules/import.test.d.ts.map +0 -1
- package/dist/resolve-modules/import.test.js +0 -47
- package/dist/resolve-modules/index.d.ts +0 -3
- package/dist/resolve-modules/index.d.ts.map +0 -1
- package/dist/resolve-modules/index.js +0 -2
- package/dist/resolve-modules/message-lint-rules/errors.d.ts +0 -9
- package/dist/resolve-modules/message-lint-rules/errors.d.ts.map +0 -1
- package/dist/resolve-modules/message-lint-rules/errors.js +0 -6
- package/dist/resolve-modules/message-lint-rules/resolveMessageLintRules.d.ts +0 -9
- package/dist/resolve-modules/message-lint-rules/resolveMessageLintRules.d.ts.map +0 -1
- package/dist/resolve-modules/message-lint-rules/resolveMessageLintRules.js +0 -24
- package/dist/resolve-modules/plugins/errors.d.ts +0 -33
- package/dist/resolve-modules/plugins/errors.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/errors.js +0 -38
- package/dist/resolve-modules/plugins/resolvePlugins.d.ts +0 -3
- package/dist/resolve-modules/plugins/resolvePlugins.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/resolvePlugins.js +0 -92
- package/dist/resolve-modules/plugins/resolvePlugins.test.d.ts +0 -2
- package/dist/resolve-modules/plugins/resolvePlugins.test.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/resolvePlugins.test.js +0 -252
- package/dist/resolve-modules/plugins/types.d.ts +0 -57
- package/dist/resolve-modules/plugins/types.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/types.js +0 -1
- package/dist/resolve-modules/plugins/types.test.d.ts +0 -2
- package/dist/resolve-modules/plugins/types.test.d.ts.map +0 -1
- package/dist/resolve-modules/plugins/types.test.js +0 -45
- package/dist/resolve-modules/resolveModules.d.ts +0 -3
- package/dist/resolve-modules/resolveModules.d.ts.map +0 -1
- package/dist/resolve-modules/resolveModules.js +0 -80
- package/dist/resolve-modules/resolveModules.test.d.ts +0 -2
- package/dist/resolve-modules/resolveModules.test.d.ts.map +0 -1
- package/dist/resolve-modules/resolveModules.test.js +0 -185
- package/dist/resolve-modules/types.d.ts +0 -63
- package/dist/resolve-modules/types.d.ts.map +0 -1
- package/dist/resolve-modules/types.js +0 -1
- package/dist/resolve-modules/validateModuleSettings.test.d.ts +0 -2
- package/dist/resolve-modules/validateModuleSettings.test.d.ts.map +0 -1
- package/dist/resolve-modules/validateModuleSettings.test.js +0 -71
- package/dist/resolve-modules/validatedModuleSettings.d.ts +0 -7
- package/dist/resolve-modules/validatedModuleSettings.d.ts.map +0 -1
- package/dist/resolve-modules/validatedModuleSettings.js +0 -11
- package/dist/storage/helper.d.ts +0 -11
- package/dist/storage/helper.d.ts.map +0 -1
- package/dist/storage/helper.js +0 -63
- package/dist/storage/helpers.test.d.ts +0 -2
- package/dist/storage/helpers.test.d.ts.map +0 -1
- package/dist/storage/helpers.test.js +0 -84
- package/dist/storage/human-id/human-readable-id.d.ts +0 -3
- package/dist/storage/human-id/human-readable-id.d.ts.map +0 -1
- package/dist/storage/human-id/human-readable-id.js +0 -20
- package/dist/storage/human-id/words.d.ts.map +0 -1
- package/dist/storage/human-id/words.test.d.ts.map +0 -1
- package/dist/telemetry/capture.d.ts.map +0 -1
- package/dist/telemetry/capture.js +0 -39
- package/dist/telemetry/groupIdentify.d.ts +0 -13
- package/dist/telemetry/groupIdentify.d.ts.map +0 -1
- package/dist/telemetry/groupIdentify.js +0 -35
- package/dist/test-utilities/createMessage.d.ts +0 -18
- package/dist/test-utilities/createMessage.d.ts.map +0 -1
- package/dist/test-utilities/createMessage.js +0 -17
- package/dist/test-utilities/createMessage.test.d.ts +0 -2
- package/dist/test-utilities/createMessage.test.d.ts.map +0 -1
- package/dist/test-utilities/createMessage.test.js +0 -106
- package/dist/test-utilities/index.d.ts +0 -3
- package/dist/test-utilities/index.d.ts.map +0 -1
- package/dist/test-utilities/index.js +0 -2
- package/dist/test-utilities/sleep.d.ts +0 -4
- package/dist/test-utilities/sleep.d.ts.map +0 -1
- package/dist/test-utilities/sleep.js +0 -9
- package/dist/v2/helper.d.ts +0 -43
- package/dist/v2/helper.d.ts.map +0 -1
- package/dist/v2/helper.js +0 -75
- package/dist/v2/helper.test.d.ts +0 -2
- package/dist/v2/helper.test.d.ts.map +0 -1
- package/dist/v2/helper.test.js +0 -92
- package/dist/v2/index.d.ts +0 -4
- package/dist/v2/index.d.ts.map +0 -1
- package/dist/v2/index.js +0 -2
- package/dist/v2/mocks/index.d.ts +0 -3
- package/dist/v2/mocks/index.d.ts.map +0 -1
- package/dist/v2/mocks/index.js +0 -2
- package/dist/v2/mocks/multipleMatcher/bundle.d.ts +0 -3
- package/dist/v2/mocks/multipleMatcher/bundle.d.ts.map +0 -1
- package/dist/v2/mocks/multipleMatcher/bundle.js +0 -194
- package/dist/v2/mocks/multipleMatcher/bundle.test.d.ts +0 -2
- package/dist/v2/mocks/multipleMatcher/bundle.test.d.ts.map +0 -1
- package/dist/v2/mocks/multipleMatcher/bundle.test.js +0 -10
- package/dist/v2/mocks/plural/bundle.d.ts +0 -3
- package/dist/v2/mocks/plural/bundle.d.ts.map +0 -1
- package/dist/v2/mocks/plural/bundle.js +0 -162
- package/dist/v2/mocks/plural/bundle.test.d.ts +0 -2
- package/dist/v2/mocks/plural/bundle.test.d.ts.map +0 -1
- package/dist/v2/mocks/plural/bundle.test.js +0 -15
- package/dist/v2/shim.d.ts +0 -12
- package/dist/v2/shim.d.ts.map +0 -1
- package/dist/v2/shim.js +0 -151
- package/dist/v2/shim.test.d.ts +0 -2
- package/dist/v2/shim.test.d.ts.map +0 -1
- package/dist/v2/shim.test.js +0 -49
- package/dist/v2/stubQueryApi.d.ts +0 -9
- package/dist/v2/stubQueryApi.d.ts.map +0 -1
- package/dist/v2/stubQueryApi.js +0 -38
- package/dist/v2/types.d.ts +0 -521
- package/dist/v2/types.d.ts.map +0 -1
- package/dist/v2/types.js +0 -78
- package/dist/validateProjectPath.d.ts +0 -17
- package/dist/validateProjectPath.d.ts.map +0 -1
- package/dist/validateProjectPath.js +0 -31
- package/dist/validateProjectPath.test.d.ts +0 -2
- package/dist/validateProjectPath.test.d.ts.map +0 -1
- package/dist/validateProjectPath.test.js +0 -40
- package/dist/versionedInterfaces.d.ts +0 -8
- package/dist/versionedInterfaces.d.ts.map +0 -1
- package/dist/versionedInterfaces.js +0 -8
- package/src/adapter/solidAdapter.test.ts +0 -472
- package/src/adapter/solidAdapter.ts +0 -79
- package/src/api.test-d.ts +0 -8
- package/src/api.ts +0 -116
- package/src/createMessageLintReportsQuery.ts +0 -225
- package/src/createMessagesQuery.test.ts +0 -538
- package/src/createMessagesQuery.ts +0 -635
- package/src/createNewProject.test.ts +0 -105
- package/src/createNewProject.ts +0 -46
- package/src/createNodeishFsWithAbsolutePaths.test.ts +0 -55
- package/src/createNodeishFsWithAbsolutePaths.ts +0 -52
- package/src/createNodeishFsWithWatcher.test.ts +0 -50
- package/src/createNodeishFsWithWatcher.ts +0 -85
- package/src/defaultProjectSettings.ts +0 -26
- package/src/env-variables/.prettierignore +0 -1
- package/src/env-variables/createIndexFile.js +0 -28
- package/src/errors.ts +0 -84
- package/src/lint/index.ts +0 -2
- package/src/lint/message/errors.ts +0 -9
- package/src/lint/message/lintMessages.test.ts +0 -126
- package/src/lint/message/lintMessages.ts +0 -25
- package/src/lint/message/lintSingleMessage.test.ts +0 -191
- package/src/lint/message/lintSingleMessage.ts +0 -57
- package/src/listProjects.test.ts +0 -91
- package/src/listProjects.ts +0 -48
- package/src/loadProject.test.ts +0 -1173
- package/src/loadProject.ts +0 -460
- package/src/messages/errors.ts +0 -25
- package/src/messages/index.ts +0 -2
- package/src/messages/variant.test.ts +0 -511
- package/src/messages/variant.ts +0 -247
- package/src/migrations/maybeAddModuleCache.ts +0 -68
- package/src/migrations/maybeCreateFirstProjectId.test.ts +0 -31
- package/src/migrations/maybeCreateFirstProjectId.ts +0 -51
- package/src/migrations/migrateToDirectory.test.ts +0 -54
- package/src/migrations/migrateToDirectory.ts +0 -62
- package/src/parseConfig.ts +0 -35
- package/src/persistence/batchedIO.test.ts +0 -63
- package/src/persistence/batchedIO.ts +0 -64
- package/src/persistence/filelock/acquireFileLock.ts +0 -129
- package/src/persistence/filelock/releaseLock.ts +0 -29
- package/src/persistence/store.test.ts +0 -102
- package/src/persistence/store.ts +0 -119
- package/src/persistence/storeApi.ts +0 -19
- package/src/reactivity/map.ts +0 -135
- package/src/reactivity/solid.test.ts +0 -222
- package/src/reactivity/solid.ts +0 -42
- package/src/reactivity/trigger.ts +0 -46
- package/src/resolve-modules/cache.ts +0 -89
- package/src/resolve-modules/errors.ts +0 -69
- package/src/resolve-modules/import.test.ts +0 -62
- package/src/resolve-modules/import.ts +0 -133
- package/src/resolve-modules/index.ts +0 -2
- package/src/resolve-modules/message-lint-rules/errors.ts +0 -9
- package/src/resolve-modules/message-lint-rules/resolveMessageLintRules.ts +0 -27
- package/src/resolve-modules/plugins/errors.ts +0 -56
- package/src/resolve-modules/plugins/resolvePlugins.test.ts +0 -301
- package/src/resolve-modules/plugins/resolvePlugins.ts +0 -129
- package/src/resolve-modules/plugins/types.test.ts +0 -53
- package/src/resolve-modules/plugins/types.ts +0 -76
- package/src/resolve-modules/resolveModules.test.ts +0 -224
- package/src/resolve-modules/resolveModules.ts +0 -113
- package/src/resolve-modules/types.ts +0 -72
- package/src/resolve-modules/validateModuleSettings.test.ts +0 -85
- package/src/resolve-modules/validatedModuleSettings.ts +0 -19
- package/src/storage/helper.ts +0 -74
- package/src/storage/helpers.test.ts +0 -95
- package/src/storage/human-id/human-readable-id.ts +0 -27
- package/src/telemetry/capture.ts +0 -49
- package/src/telemetry/groupIdentify.ts +0 -41
- package/src/test-utilities/createMessage.test.ts +0 -118
- package/src/test-utilities/createMessage.ts +0 -21
- package/src/test-utilities/index.ts +0 -2
- package/src/test-utilities/sleep.ts +0 -11
- package/src/v2/helper.test.ts +0 -95
- package/src/v2/helper.ts +0 -98
- package/src/v2/index.ts +0 -3
- package/src/v2/mocks/index.ts +0 -2
- package/src/v2/mocks/multipleMatcher/bundle.test.ts +0 -11
- package/src/v2/mocks/multipleMatcher/bundle.ts +0 -196
- package/src/v2/mocks/plural/bundle.test.ts +0 -18
- package/src/v2/mocks/plural/bundle.ts +0 -164
- package/src/v2/shim.test.ts +0 -56
- package/src/v2/shim.ts +0 -173
- package/src/v2/stubQueryApi.ts +0 -43
- package/src/v2/types.ts +0 -159
- package/src/validateProjectPath.test.ts +0 -50
- package/src/validateProjectPath.ts +0 -38
- package/src/versionedInterfaces.ts +0 -9
- /package/dist/{storage/human-id → human-id}/words.d.ts +0 -0
- /package/dist/{storage/human-id → human-id}/words.test.d.ts +0 -0
- /package/dist/{loadProject.test.d.ts → project/loadProject.test.d.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d18172ff-c888-5198-afa4-b43d012b6685")}catch(e){}}();
|
|
3
|
+
import { Declaration, Pattern, VariableReference, } from "../json-schema/pattern.js";
|
|
4
|
+
export function applySchema(args) {
|
|
5
|
+
const foreignKeyActivated = args.sqlite.exec("PRAGMA foreign_keys", {
|
|
6
|
+
returnValue: "resultRows",
|
|
7
|
+
});
|
|
8
|
+
if (
|
|
9
|
+
// first row that is returned
|
|
10
|
+
// first column of the first row
|
|
11
|
+
// is equal to 0, then foreign keys are disabled
|
|
12
|
+
foreignKeyActivated[0][0] === 0) {
|
|
13
|
+
args.sqlite.exec("PRAGMA foreign_keys = ON", {
|
|
14
|
+
returnValue: "resultRows",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
args.sqlite.exec(`
|
|
18
|
+
CREATE TABLE IF NOT EXISTS bundle (
|
|
19
|
+
id TEXT PRIMARY KEY DEFAULT (human_id()),
|
|
20
|
+
declarations BLOB NOT NULL DEFAULT (jsonb('[]'))
|
|
21
|
+
) strict;
|
|
22
|
+
|
|
23
|
+
CREATE TABLE IF NOT EXISTS message (
|
|
24
|
+
id TEXT PRIMARY KEY DEFAULT (uuid_v7()),
|
|
25
|
+
bundle_id TEXT NOT NULL,
|
|
26
|
+
locale TEXT NOT NULL,
|
|
27
|
+
selectors BLOB NOT NULL DEFAULT (jsonb('[]')),
|
|
28
|
+
FOREIGN KEY (bundle_id) REFERENCES bundle(id) ON DELETE CASCADE
|
|
29
|
+
) strict;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
CREATE TABLE IF NOT EXISTS variant (
|
|
33
|
+
id TEXT PRIMARY KEY DEFAULT (uuid_v7()),
|
|
34
|
+
message_id TEXT NOT NULL,
|
|
35
|
+
matches BLOB NOT NULL DEFAULT (jsonb('[]')),
|
|
36
|
+
pattern BLOB NOT NULL DEFAULT (jsonb('[]')),
|
|
37
|
+
FOREIGN KEY (message_id) REFERENCES message(id) ON DELETE CASCADE
|
|
38
|
+
) strict;
|
|
39
|
+
|
|
40
|
+
CREATE INDEX IF NOT EXISTS idx_message_bundle_id ON message (bundle_id);
|
|
41
|
+
CREATE INDEX IF NOT EXISTS idx_variant_message_id ON variant (message_id);
|
|
42
|
+
`);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=schema.js.map
|
|
45
|
+
//# debugId=d18172ff-c888-5198-afa4-b43d012b6685
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sources":["database/schema.ts"],"sourceRoot":"/","sourcesContent":["import type { Generated, Insertable, Selectable, Updateable } from \"kysely\";\nimport type { SqliteDatabase } from \"sqlite-wasm-kysely\";\nimport {\n\tDeclaration,\n\tPattern,\n\tVariableReference,\n} from \"../json-schema/pattern.js\";\n\nexport function applySchema(args: { sqlite: SqliteDatabase }) {\n\tconst foreignKeyActivated: any = args.sqlite.exec(\"PRAGMA foreign_keys\", {\n\t\treturnValue: \"resultRows\",\n\t});\n\tif (\n\t\t// first row that is returned\n\t\t// first column of the first row\n\t\t// is equal to 0, then foreign keys are disabled\n\t\tforeignKeyActivated[0][0] === 0\n\t) {\n\t\targs.sqlite.exec(\"PRAGMA foreign_keys = ON\", {\n\t\t\treturnValue: \"resultRows\",\n\t\t});\n\t}\n\n\targs.sqlite.exec(`\nCREATE TABLE IF NOT EXISTS bundle (\n id TEXT PRIMARY KEY DEFAULT (human_id()),\n\tdeclarations BLOB NOT NULL DEFAULT (jsonb('[]'))\n) strict;\n\nCREATE TABLE IF NOT EXISTS message (\n id TEXT PRIMARY KEY DEFAULT (uuid_v7()), \n bundle_id TEXT NOT NULL,\n locale TEXT NOT NULL,\n selectors BLOB NOT NULL DEFAULT (jsonb('[]')),\n FOREIGN KEY (bundle_id) REFERENCES bundle(id) ON DELETE CASCADE\n) strict;\n\n\nCREATE TABLE IF NOT EXISTS variant (\n id TEXT PRIMARY KEY DEFAULT (uuid_v7()), \n message_id TEXT NOT NULL,\n matches BLOB NOT NULL DEFAULT (jsonb('[]')),\n pattern BLOB NOT NULL DEFAULT (jsonb('[]')),\n FOREIGN KEY (message_id) REFERENCES message(id) ON DELETE CASCADE\n) strict;\n \nCREATE INDEX IF NOT EXISTS idx_message_bundle_id ON message (bundle_id);\nCREATE INDEX IF NOT EXISTS idx_variant_message_id ON variant (message_id);\n\t\t`);\n}\n\nexport type InlangDatabaseSchema = {\n\tbundle: BundleTable;\n\tmessage: MessageTable;\n\tvariant: VariantTable;\n};\n\ntype BundleTable = {\n\tid: Generated<string>;\n\tdeclarations: Generated<Array<Declaration>>;\n};\n\ntype MessageTable = {\n\tid: Generated<string>;\n\tbundleId: string;\n\tlocale: string;\n\tselectors: Generated<Array<VariableReference>>;\n};\n\ntype VariantTable = {\n\tid: Generated<string>;\n\tmessageId: string;\n\tmatches: Generated<Array<Match>>;\n\tpattern: Generated<Pattern>;\n};\n\n/**\n * A match is a variable reference that is either a literal or a catch-all.\n *\n * https://github.com/opral/inlang-sdk/issues/205\n *\n * @example\n * match = { type: \"match\", name: \"gender\", value: { type: \"literal\", value: \"male\" }}\n */\nexport type Match = LiteralMatch | CatchAllMatch;\n\nexport type LiteralMatch = {\n\ttype: \"literal-match\";\n\tkey: VariableReference[\"name\"];\n\tvalue: string;\n};\nexport type CatchAllMatch = {\n\ttype: \"catchall-match\";\n\tkey: VariableReference[\"name\"];\n};\n\nexport type Bundle = Selectable<BundleTable>;\nexport type NewBundle = Insertable<BundleTable>;\nexport type BundleUpdate = Updateable<BundleTable>;\n\nexport type Message = Selectable<MessageTable>;\nexport type NewMessage = Insertable<MessageTable>;\nexport type MessageUpdate = Updateable<MessageTable>;\n\nexport type Variant = Selectable<VariantTable>;\nexport type NewVariant = Insertable<VariantTable>;\nexport type VariantUpdate = Updateable<VariantTable>;\n\nexport type MessageNested = Message & {\n\tvariants: Variant[];\n};\nexport type NewMessageNested = NewMessage & {\n\tvariants: NewVariant[];\n};\nexport type MessageNestedUpdate = Updateable<MessageTable> & {\n\tvariants: VariantUpdate[];\n};\n\nexport type BundleNested = Bundle & {\n\tmessages: MessageNested[];\n};\nexport type NewBundleNested = NewBundle & {\n\tmessages: NewMessageNested[];\n};\nexport type BundleNestedUpdate = BundleUpdate & {\n\tmessages: MessageNestedUpdate[];\n};\n"],"names":[],"mappings":";;AAEA,OAAO,EACN,WAAW,EACX,OAAO,EACP,iBAAiB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,WAAW,CAAC,IAAgC;IAC3D,MAAM,mBAAmB,GAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;QACxE,WAAW,EAAE,YAAY;KACzB,CAAC,CAAC;IACH;IACC,6BAA6B;IAC7B,gCAAgC;IAChC,gDAAgD;IAChD,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAC9B,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE;YAC5C,WAAW,EAAE,YAAY;SACzB,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBf,CAAC,CAAC;AACL,CAAC","debug_id":"d18172ff-c888-5198-afa4-b43d012b6685"}
|
package/dist/helper.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ProjectSettings } from "./json-schema/settings.js";
|
|
2
|
+
import type { Match, NewBundleNested, NewMessageNested, Variant } from "./database/schema.js";
|
|
3
|
+
import type { Text } from "./json-schema/pattern.js";
|
|
4
|
+
/**
|
|
5
|
+
* create v2 Bundle with a random human ID
|
|
6
|
+
*
|
|
7
|
+
* @deprecated
|
|
8
|
+
*
|
|
9
|
+
* use the database directly
|
|
10
|
+
*
|
|
11
|
+
* - less code because the database has default values
|
|
12
|
+
* - `createMessage` is misleading because it does not treat expressions in the text
|
|
13
|
+
*
|
|
14
|
+
* @example createBundle({
|
|
15
|
+
* messages: [
|
|
16
|
+
* createMessage({locale: "en", text: "Hello world!"})
|
|
17
|
+
* createMessage({locale: "de", text: "Hallo Welt!"})
|
|
18
|
+
* ]
|
|
19
|
+
* })
|
|
20
|
+
*/
|
|
21
|
+
export declare function createBundle(args: {
|
|
22
|
+
id?: string;
|
|
23
|
+
messages: NewMessageNested[];
|
|
24
|
+
}): NewBundleNested;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @deprecated
|
|
28
|
+
* use the database directly
|
|
29
|
+
*
|
|
30
|
+
* - text will always be a string, no matter
|
|
31
|
+
* if an expression is provided like hello "{username}"
|
|
32
|
+
* - the database has default values
|
|
33
|
+
*
|
|
34
|
+
* ```
|
|
35
|
+
* await project.db.insertInto("message").values({
|
|
36
|
+
* bundleId: "bundleId",
|
|
37
|
+
* pattern: []
|
|
38
|
+
* ...
|
|
39
|
+
* })
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* create v2 Messsage AST with a randomId, and text-only pattern
|
|
43
|
+
* @example createMessage({locale: "en", text: "Hello world"})
|
|
44
|
+
*/
|
|
45
|
+
export declare function createMessage(args: {
|
|
46
|
+
bundleId: string;
|
|
47
|
+
locale: ProjectSettings["locales"][number];
|
|
48
|
+
text: string;
|
|
49
|
+
matches?: Match[];
|
|
50
|
+
}): NewMessageNested;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @deprecated
|
|
54
|
+
*
|
|
55
|
+
* use the database directly
|
|
56
|
+
*
|
|
57
|
+
* - less code because the database has default values
|
|
58
|
+
* - `text` is misleading because it does not treat expressions in the text
|
|
59
|
+
*
|
|
60
|
+
* create v2 Variant AST with text-only pattern
|
|
61
|
+
* @example createVariant({match: ["*"], text: "Hello world"})
|
|
62
|
+
*/
|
|
63
|
+
export declare function createVariant(args: {
|
|
64
|
+
messageId: string;
|
|
65
|
+
id?: string;
|
|
66
|
+
text?: string;
|
|
67
|
+
matches?: Match[];
|
|
68
|
+
pattern?: Variant["pattern"];
|
|
69
|
+
}): Variant;
|
|
70
|
+
export declare function toTextElement(text: string): Text;
|
|
71
|
+
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"/","sources":["helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,KAAK,EACX,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC7B,GAAG,eAAe,CAKlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,GAAG,gBAAgB,CAenB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC7B,GAAG,OAAO,CAOV;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAKhD"}
|
package/dist/helper.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="72758e09-d619-5220-a608-230edefa2a5f")}catch(e){}}();
|
|
3
|
+
import { v4 as uuid } from "uuid";
|
|
4
|
+
import { humanId } from "./human-id/human-id.js";
|
|
5
|
+
/**
|
|
6
|
+
* create v2 Bundle with a random human ID
|
|
7
|
+
*
|
|
8
|
+
* @deprecated
|
|
9
|
+
*
|
|
10
|
+
* use the database directly
|
|
11
|
+
*
|
|
12
|
+
* - less code because the database has default values
|
|
13
|
+
* - `createMessage` is misleading because it does not treat expressions in the text
|
|
14
|
+
*
|
|
15
|
+
* @example createBundle({
|
|
16
|
+
* messages: [
|
|
17
|
+
* createMessage({locale: "en", text: "Hello world!"})
|
|
18
|
+
* createMessage({locale: "de", text: "Hallo Welt!"})
|
|
19
|
+
* ]
|
|
20
|
+
* })
|
|
21
|
+
*/
|
|
22
|
+
export function createBundle(args) {
|
|
23
|
+
return {
|
|
24
|
+
id: args.id ?? humanId(),
|
|
25
|
+
messages: args.messages,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @deprecated
|
|
31
|
+
* use the database directly
|
|
32
|
+
*
|
|
33
|
+
* - text will always be a string, no matter
|
|
34
|
+
* if an expression is provided like hello "{username}"
|
|
35
|
+
* - the database has default values
|
|
36
|
+
*
|
|
37
|
+
* ```
|
|
38
|
+
* await project.db.insertInto("message").values({
|
|
39
|
+
* bundleId: "bundleId",
|
|
40
|
+
* pattern: []
|
|
41
|
+
* ...
|
|
42
|
+
* })
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* create v2 Messsage AST with a randomId, and text-only pattern
|
|
46
|
+
* @example createMessage({locale: "en", text: "Hello world"})
|
|
47
|
+
*/
|
|
48
|
+
export function createMessage(args) {
|
|
49
|
+
const messageId = uuid();
|
|
50
|
+
return {
|
|
51
|
+
bundleId: args.bundleId,
|
|
52
|
+
id: messageId,
|
|
53
|
+
locale: args.locale,
|
|
54
|
+
selectors: [],
|
|
55
|
+
variants: [
|
|
56
|
+
createVariant({
|
|
57
|
+
messageId: messageId,
|
|
58
|
+
text: args.text,
|
|
59
|
+
matches: args.matches,
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @deprecated
|
|
67
|
+
*
|
|
68
|
+
* use the database directly
|
|
69
|
+
*
|
|
70
|
+
* - less code because the database has default values
|
|
71
|
+
* - `text` is misleading because it does not treat expressions in the text
|
|
72
|
+
*
|
|
73
|
+
* create v2 Variant AST with text-only pattern
|
|
74
|
+
* @example createVariant({match: ["*"], text: "Hello world"})
|
|
75
|
+
*/
|
|
76
|
+
export function createVariant(args) {
|
|
77
|
+
return {
|
|
78
|
+
messageId: args.messageId,
|
|
79
|
+
id: args.id ? args.id : uuid(),
|
|
80
|
+
matches: args.matches ? args.matches : [],
|
|
81
|
+
pattern: args.pattern ? args.pattern : [toTextElement(args.text ?? "")],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function toTextElement(text) {
|
|
85
|
+
return {
|
|
86
|
+
type: "text",
|
|
87
|
+
value: text,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=helper.js.map
|
|
91
|
+
//# debugId=72758e09-d619-5220-a608-230edefa2a5f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sources":["helper.ts"],"sourceRoot":"/","sourcesContent":["import { v4 as uuid } from \"uuid\";\nimport type { ProjectSettings } from \"./json-schema/settings.js\";\nimport { humanId } from \"./human-id/human-id.js\";\nimport type {\n\tMatch,\n\tNewBundleNested,\n\tNewMessageNested,\n\tVariant,\n} from \"./database/schema.js\";\nimport type { Text } from \"./json-schema/pattern.js\";\n\n/**\n * create v2 Bundle with a random human ID\n *\n * @deprecated\n *\n * use the database directly\n *\n * - less code because the database has default values\n * - `createMessage` is misleading because it does not treat expressions in the text\n *\n * @example createBundle({\n * messages: [\n * \t\t createMessage({locale: \"en\", text: \"Hello world!\"})\n * \t\t createMessage({locale: \"de\", text: \"Hallo Welt!\"})\n * ]\n * })\n */\nexport function createBundle(args: {\n\tid?: string;\n\tmessages: NewMessageNested[];\n}): NewBundleNested {\n\treturn {\n\t\tid: args.id ?? humanId(),\n\t\tmessages: args.messages,\n\t};\n}\n\n/**\n *\n * @deprecated\n * use the database directly\n *\n * - text will always be a string, no matter\n * if an expression is provided like hello \"{username}\"\n * - the database has default values\n *\n * ```\n * await project.db.insertInto(\"message\").values({\n * \t\tbundleId: \"bundleId\",\n * pattern: []\n * \t\t...\n * })\n * ```\n *\n * create v2 Messsage AST with a randomId, and text-only pattern\n * @example createMessage({locale: \"en\", text: \"Hello world\"})\n */\nexport function createMessage(args: {\n\tbundleId: string;\n\tlocale: ProjectSettings[\"locales\"][number];\n\ttext: string;\n\tmatches?: Match[];\n}): NewMessageNested {\n\tconst messageId = uuid();\n\treturn {\n\t\tbundleId: args.bundleId,\n\t\tid: messageId,\n\t\tlocale: args.locale,\n\t\tselectors: [],\n\t\tvariants: [\n\t\t\tcreateVariant({\n\t\t\t\tmessageId: messageId,\n\t\t\t\ttext: args.text,\n\t\t\t\tmatches: args.matches,\n\t\t\t}),\n\t\t],\n\t};\n}\n\n/**\n *\n * @deprecated\n *\n * use the database directly\n *\n * - less code because the database has default values\n * - `text` is misleading because it does not treat expressions in the text\n *\n * create v2 Variant AST with text-only pattern\n * @example createVariant({match: [\"*\"], text: \"Hello world\"})\n */\nexport function createVariant(args: {\n\tmessageId: string;\n\tid?: string;\n\ttext?: string;\n\tmatches?: Match[];\n\tpattern?: Variant[\"pattern\"];\n}): Variant {\n\treturn {\n\t\tmessageId: args.messageId,\n\t\tid: args.id ? args.id : uuid(),\n\t\tmatches: args.matches ? args.matches : [],\n\t\tpattern: args.pattern ? args.pattern : [toTextElement(args.text ?? \"\")],\n\t};\n}\n\nexport function toTextElement(text: string): Text {\n\treturn {\n\t\ttype: \"text\",\n\t\tvalue: text,\n\t};\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AASjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,YAAY,CAAC,IAG5B;IACA,OAAO;QACN,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,OAAO,EAAE;QACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACvB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,aAAa,CAAC,IAK7B;IACA,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;IACzB,OAAO;QACN,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,EAAE,EAAE,SAAS;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACT,aAAa,CAAC;gBACb,SAAS,EAAE,SAAS;gBACpB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;aACrB,CAAC;SACF;KACD,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,IAM7B;IACA,OAAO;QACN,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QAC9B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACzC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;KACvE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACzC,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,IAAI;KACX,CAAC;AACH,CAAC","debug_id":"72758e09-d619-5220-a608-230edefa2a5f"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human-id.d.ts","sourceRoot":"/","sources":["human-id/human-id.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,WAMtB;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bf56aec1-86e6-5dd9-b6fb-e21a5732c0d6")}catch(e){}}();
|
|
3
|
+
import { adjectives, animals, verbs } from "./words.js";
|
|
4
|
+
export function humanId() {
|
|
5
|
+
return `${adjectives[Math.floor(Math.random() * 256)]}_${adjectives[Math.floor(Math.random() * 256)]}_${animals[Math.floor(Math.random() * 256)]}_${verbs[Math.floor(Math.random() * 256)]}`;
|
|
6
|
+
}
|
|
7
|
+
export function isHumanId(id) {
|
|
8
|
+
// naive implementation (good enough for now)
|
|
9
|
+
return id.split("_").length === 4;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=human-id.js.map
|
|
12
|
+
//# debugId=bf56aec1-86e6-5dd9-b6fb-e21a5732c0d6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human-id.js","sources":["human-id/human-id.ts"],"sourceRoot":"/","sourcesContent":["import { adjectives, animals, verbs } from \"./words.js\";\n\nexport function humanId() {\n\treturn `${adjectives[Math.floor(Math.random() * 256)]}_${\n\t\tadjectives[Math.floor(Math.random() * 256)]\n\t}_${animals[Math.floor(Math.random() * 256)]}_${\n\t\tverbs[Math.floor(Math.random() * 256)]\n\t}`;\n}\n\nexport function isHumanId(id: string): boolean {\n\t// naive implementation (good enough for now)\n\treturn id.split(\"_\").length === 4;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,UAAU,OAAO;IACtB,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,IACpD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAC3C,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,IAC3C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CACtC,EAAE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAU;IACnC,6CAA6C;IAC7C,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC","debug_id":"bf56aec1-86e6-5dd9-b6fb-e21a5732c0d6"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.d.ts","sourceRoot":"/","sources":["human-id/words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAiQnB,CAAC;AAEF,eAAO,MAAM,UAAU,UAiQtB,CAAC;AAEF,eAAO,MAAM,OAAO,UAiQnB,CAAC;AAEF,eAAO,MAAM,KAAK,UAiQjB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e8972a8a-c3a2-5f74-9499-172808f5a618")}catch(e){}}();
|
|
1
3
|
export const animals = [
|
|
2
4
|
"albatross",
|
|
3
5
|
"alligator",
|
|
@@ -1030,3 +1032,5 @@ export const verbs = [
|
|
|
1030
1032
|
"zip",
|
|
1031
1033
|
"zoom",
|
|
1032
1034
|
];
|
|
1035
|
+
//# sourceMappingURL=words.js.map
|
|
1036
|
+
//# debugId=e8972a8a-c3a2-5f74-9499-172808f5a618
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.js","sources":["human-id/words.ts"],"sourceRoot":"/","sourcesContent":["export const animals = [\n\t\"albatross\",\n\t\"alligator\",\n\t\"alpaca\",\n\t\"anaconda\",\n\t\"angelfish\",\n\t\"ant\",\n\t\"anteater\",\n\t\"antelope\",\n\t\"ape\",\n\t\"baboon\",\n\t\"badger\",\n\t\"barbel\",\n\t\"bat\",\n\t\"bear\",\n\t\"beaver\",\n\t\"bee\",\n\t\"beetle\",\n\t\"bird\",\n\t\"bison\",\n\t\"blackbird\",\n\t\"boar\",\n\t\"bobcat\",\n\t\"bulldog\",\n\t\"bullock\",\n\t\"bumblebee\",\n\t\"butterfly\",\n\t\"buzzard\",\n\t\"camel\",\n\t\"canary\",\n\t\"capybara\",\n\t\"carp\",\n\t\"cat\",\n\t\"cheetah\",\n\t\"chicken\",\n\t\"chipmunk\",\n\t\"clownfish\",\n\t\"cobra\",\n\t\"cockroach\",\n\t\"cod\",\n\t\"cougar\",\n\t\"cow\",\n\t\"cowfish\",\n\t\"coyote\",\n\t\"crab\",\n\t\"crocodile\",\n\t\"crossbill\",\n\t\"crow\",\n\t\"cuckoo\",\n\t\"dachshund\",\n\t\"deer\",\n\t\"dingo\",\n\t\"dog\",\n\t\"dolphin\",\n\t\"donkey\",\n\t\"dove\",\n\t\"dragonfly\",\n\t\"duck\",\n\t\"eagle\",\n\t\"earthworm\",\n\t\"eel\",\n\t\"elephant\",\n\t\"elk\",\n\t\"emu\",\n\t\"falcon\",\n\t\"felix\",\n\t\"finch\",\n\t\"fireant\",\n\t\"firefox\",\n\t\"fish\",\n\t\"flamingo\",\n\t\"flea\",\n\t\"florian\",\n\t\"fly\",\n\t\"fox\",\n\t\"frog\",\n\t\"gadfly\",\n\t\"gazelle\",\n\t\"gecko\",\n\t\"gibbon\",\n\t\"giraffe\",\n\t\"goat\",\n\t\"goldfish\",\n\t\"goose\",\n\t\"gopher\",\n\t\"gorilla\",\n\t\"grebe\",\n\t\"grizzly\",\n\t\"gull\",\n\t\"guppy\",\n\t\"haddock\",\n\t\"halibut\",\n\t\"hamster\",\n\t\"hare\",\n\t\"hawk\",\n\t\"hedgehog\",\n\t\"herring\",\n\t\"hornet\",\n\t\"horse\",\n\t\"hound\",\n\t\"husky\",\n\t\"hyena\",\n\t\"ibex\",\n\t\"iguana\",\n\t\"impala\",\n\t\"insect\",\n\t\"jackal\",\n\t\"jackdaw\",\n\t\"jaguar\",\n\t\"jan\",\n\t\"jannes\",\n\t\"javelina\",\n\t\"jay\",\n\t\"jellyfish\",\n\t\"jurgen\",\n\t\"kangaroo\",\n\t\"kestrel\",\n\t\"kitten\",\n\t\"koala\",\n\t\"kudu\",\n\t\"ladybug\",\n\t\"lamb\",\n\t\"lark\",\n\t\"larva\",\n\t\"lemming\",\n\t\"lemur\",\n\t\"leopard\",\n\t\"liger\",\n\t\"lion\",\n\t\"lionfish\",\n\t\"lizard\",\n\t\"llama\",\n\t\"lobster\",\n\t\"loris\",\n\t\"lynx\",\n\t\"macaw\",\n\t\"maggot\",\n\t\"mallard\",\n\t\"mammoth\",\n\t\"manatee\",\n\t\"mantis\",\n\t\"mare\",\n\t\"marlin\",\n\t\"marmot\",\n\t\"marten\",\n\t\"martin\",\n\t\"mayfly\",\n\t\"meerkat\",\n\t\"midge\",\n\t\"millipede\",\n\t\"mink\",\n\t\"mole\",\n\t\"mongoose\",\n\t\"monkey\",\n\t\"moose\",\n\t\"moth\",\n\t\"mouse\",\n\t\"mule\",\n\t\"myna\",\n\t\"newt\",\n\t\"niklas\",\n\t\"nils\",\n\t\"nuthatch\",\n\t\"ocelot\",\n\t\"octopus\",\n\t\"okapi\",\n\t\"opossum\",\n\t\"orangutan\",\n\t\"oryx\",\n\t\"osprey\",\n\t\"ostrich\",\n\t\"otter\",\n\t\"owl\",\n\t\"ox\",\n\t\"panda\",\n\t\"panther\",\n\t\"parakeet\",\n\t\"parrot\",\n\t\"peacock\",\n\t\"pelican\",\n\t\"penguin\",\n\t\"pig\",\n\t\"pigeon\",\n\t\"piranha\",\n\t\"platypus\",\n\t\"polecat\",\n\t\"pony\",\n\t\"poodle\",\n\t\"porpoise\",\n\t\"puffin\",\n\t\"pug\",\n\t\"puma\",\n\t\"quail\",\n\t\"rabbit\",\n\t\"racoon\",\n\t\"rat\",\n\t\"raven\",\n\t\"ray\",\n\t\"reindeer\",\n\t\"robin\",\n\t\"rook\",\n\t\"rooster\",\n\t\"salmon\",\n\t\"samuel\",\n\t\"sawfish\",\n\t\"scallop\",\n\t\"seahorse\",\n\t\"seal\",\n\t\"shad\",\n\t\"shark\",\n\t\"sheep\",\n\t\"shell\",\n\t\"shrike\",\n\t\"shrimp\",\n\t\"skate\",\n\t\"skunk\",\n\t\"sloth\",\n\t\"slug\",\n\t\"snail\",\n\t\"snake\",\n\t\"sparrow\",\n\t\"spider\",\n\t\"squid\",\n\t\"squirrel\",\n\t\"starfish\",\n\t\"stingray\",\n\t\"stork\",\n\t\"swallow\",\n\t\"swan\",\n\t\"tadpole\",\n\t\"tapir\",\n\t\"termite\",\n\t\"tern\",\n\t\"thrush\",\n\t\"tiger\",\n\t\"toad\",\n\t\"tortoise\",\n\t\"toucan\",\n\t\"trout\",\n\t\"tuna\",\n\t\"turkey\",\n\t\"turtle\",\n\t\"vole\",\n\t\"vulture\",\n\t\"wallaby\",\n\t\"walrus\",\n\t\"warbler\",\n\t\"warthog\",\n\t\"wasp\",\n\t\"weasel\",\n\t\"whale\",\n\t\"wolf\",\n\t\"wombat\",\n\t\"worm\",\n\t\"wren\",\n\t\"yak\",\n\t\"zebra\",\n];\n\nexport const adjectives = [\n\t\"acidic\",\n\t\"active\",\n\t\"actual\",\n\t\"agent\",\n\t\"ago\",\n\t\"alert\",\n\t\"alive\",\n\t\"aloof\",\n\t\"antsy\",\n\t\"any\",\n\t\"aqua\",\n\t\"arable\",\n\t\"awake\",\n\t\"aware\",\n\t\"away\",\n\t\"awful\",\n\t\"bad\",\n\t\"bald\",\n\t\"basic\",\n\t\"best\",\n\t\"big\",\n\t\"bland\",\n\t\"blue\",\n\t\"bold\",\n\t\"born\",\n\t\"brave\",\n\t\"brief\",\n\t\"bright\",\n\t\"broad\",\n\t\"busy\",\n\t\"calm\",\n\t\"candid\",\n\t\"careful\",\n\t\"caring\",\n\t\"chunky\",\n\t\"civil\",\n\t\"clean\",\n\t\"clear\",\n\t\"close\",\n\t\"cool\",\n\t\"cozy\",\n\t\"crazy\",\n\t\"crisp\",\n\t\"cuddly\",\n\t\"curly\",\n\t\"cute\",\n\t\"dark\",\n\t\"day\",\n\t\"deft\",\n\t\"direct\",\n\t\"dirty\",\n\t\"dizzy\",\n\t\"drab\",\n\t\"dry\",\n\t\"due\",\n\t\"dull\",\n\t\"each\",\n\t\"early\",\n\t\"east\",\n\t\"elegant\",\n\t\"empty\",\n\t\"equal\",\n\t\"even\",\n\t\"every\",\n\t\"extra\",\n\t\"factual\",\n\t\"fair\",\n\t\"fancy\",\n\t\"few\",\n\t\"fine\",\n\t\"fit\",\n\t\"flaky\",\n\t\"flat\",\n\t\"fluffy\",\n\t\"formal\",\n\t\"frail\",\n\t\"free\",\n\t\"fresh\",\n\t\"front\",\n\t\"full\",\n\t\"fun\",\n\t\"funny\",\n\t\"fuzzy\",\n\t\"game\",\n\t\"gaudy\",\n\t\"giant\",\n\t\"glad\",\n\t\"good\",\n\t\"grand\",\n\t\"grassy\",\n\t\"gray\",\n\t\"great\",\n\t\"green\",\n\t\"gross\",\n\t\"happy\",\n\t\"heavy\",\n\t\"helpful\",\n\t\"heroic\",\n\t\"home\",\n\t\"honest\",\n\t\"hour\",\n\t\"house\",\n\t\"icy\",\n\t\"ideal\",\n\t\"inclusive\",\n\t\"inner\",\n\t\"jolly\",\n\t\"jumpy\",\n\t\"just\",\n\t\"keen\",\n\t\"key\",\n\t\"kind\",\n\t\"knotty\",\n\t\"known\",\n\t\"large\",\n\t\"last\",\n\t\"late\",\n\t\"lazy\",\n\t\"least\",\n\t\"left\",\n\t\"legal\",\n\t\"less\",\n\t\"level\",\n\t\"light\",\n\t\"lime\",\n\t\"livid\",\n\t\"lofty\",\n\t\"long\",\n\t\"loose\",\n\t\"lost\",\n\t\"loud\",\n\t\"loved\",\n\t\"low\",\n\t\"lower\",\n\t\"lucky\",\n\t\"mad\",\n\t\"main\",\n\t\"major\",\n\t\"male\",\n\t\"many\",\n\t\"maroon\",\n\t\"mealy\",\n\t\"mean\",\n\t\"mellow\",\n\t\"merry\",\n\t\"mild\",\n\t\"minor\",\n\t\"misty\",\n\t\"moving\",\n\t\"muddy\",\n\t\"mushy\",\n\t\"neat\",\n\t\"new\",\n\t\"next\",\n\t\"nice\",\n\t\"nimble\",\n\t\"noble\",\n\t\"noisy\",\n\t\"north\",\n\t\"novel\",\n\t\"odd\",\n\t\"ok\",\n\t\"only\",\n\t\"orange\",\n\t\"ornate\",\n\t\"patchy\",\n\t\"patient\",\n\t\"petty\",\n\t\"pink\",\n\t\"plain\",\n\t\"plane\",\n\t\"polite\",\n\t\"pretty\",\n\t\"proof\",\n\t\"proud\",\n\t\"quaint\",\n\t\"quick\",\n\t\"quiet\",\n\t\"raw\",\n\t\"real\",\n\t\"red\",\n\t\"round\",\n\t\"royal\",\n\t\"sad\",\n\t\"safe\",\n\t\"salty\",\n\t\"same\",\n\t\"sea\",\n\t\"seemly\",\n\t\"sharp\",\n\t\"short\",\n\t\"shy\",\n\t\"silly\",\n\t\"simple\",\n\t\"sleek\",\n\t\"slimy\",\n\t\"slow\",\n\t\"small\",\n\t\"smart\",\n\t\"smug\",\n\t\"soft\",\n\t\"solid\",\n\t\"sound\",\n\t\"sour\",\n\t\"spare\",\n\t\"spicy\",\n\t\"spry\",\n\t\"stale\",\n\t\"steep\",\n\t\"still\",\n\t\"stock\",\n\t\"stout\",\n\t\"strong\",\n\t\"suave\",\n\t\"such\",\n\t\"sunny\",\n\t\"super\",\n\t\"sweet\",\n\t\"swift\",\n\t\"tame\",\n\t\"tangy\",\n\t\"tasty\",\n\t\"teal\",\n\t\"teary\",\n\t\"tense\",\n\t\"that\",\n\t\"these\",\n\t\"this\",\n\t\"tidy\",\n\t\"tiny\",\n\t\"tired\",\n\t\"top\",\n\t\"topical\",\n\t\"tough\",\n\t\"trick\",\n\t\"trite\",\n\t\"true\",\n\t\"upper\",\n\t\"vexed\",\n\t\"vivid\",\n\t\"wacky\",\n\t\"warm\",\n\t\"watery\",\n\t\"weak\",\n\t\"weary\",\n\t\"weird\",\n\t\"white\",\n\t\"whole\",\n\t\"wide\",\n\t\"wild\",\n\t\"wise\",\n\t\"witty\",\n\t\"yummy\",\n\t\"zany\",\n\t\"zesty\",\n\t\"zippy\",\n];\n\nexport const adverbs = [\n\t\"ablaze\",\n\t\"about\",\n\t\"above\",\n\t\"abroad\",\n\t\"across\",\n\t\"adrift\",\n\t\"afloat\",\n\t\"after\",\n\t\"again\",\n\t\"ahead\",\n\t\"alike\",\n\t\"all\",\n\t\"almost\",\n\t\"alone\",\n\t\"along\",\n\t\"aloud\",\n\t\"always\",\n\t\"amazing\",\n\t\"anxious\",\n\t\"anywhere\",\n\t\"apart\",\n\t\"around\",\n\t\"arrogant\",\n\t\"aside\",\n\t\"asleep\",\n\t\"awkward\",\n\t\"back\",\n\t\"bashful\",\n\t\"beautiful\",\n\t\"before\",\n\t\"behind\",\n\t\"below\",\n\t\"beside\",\n\t\"besides\",\n\t\"beyond\",\n\t\"bitter\",\n\t\"bleak\",\n\t\"blissful\",\n\t\"boldly\",\n\t\"bravely\",\n\t\"briefly\",\n\t\"brightly\",\n\t\"brisk\",\n\t\"busily\",\n\t\"calmly\",\n\t\"carefully\",\n\t\"careless\",\n\t\"cautious\",\n\t\"certain\",\n\t\"cheerful\",\n\t\"clearly\",\n\t\"clever\",\n\t\"closely\",\n\t\"closer\",\n\t\"colorful\",\n\t\"common\",\n\t\"correct\",\n\t\"cross\",\n\t\"cruel\",\n\t\"curious\",\n\t\"daily\",\n\t\"dainty\",\n\t\"daring\",\n\t\"dear\",\n\t\"desperate\",\n\t\"diligent\",\n\t\"doubtful\",\n\t\"doubtless\",\n\t\"down\",\n\t\"downwards\",\n\t\"dreamily\",\n\t\"eager\",\n\t\"easily\",\n\t\"either\",\n\t\"elegantly\",\n\t\"else\",\n\t\"elsewhere\",\n\t\"enormous\",\n\t\"enough\",\n\t\"ever\",\n\t\"famous\",\n\t\"far\",\n\t\"fast\",\n\t\"fervent\",\n\t\"fierce\",\n\t\"fondly\",\n\t\"foolish\",\n\t\"forever\",\n\t\"forth\",\n\t\"fortunate\",\n\t\"forward\",\n\t\"frank\",\n\t\"freely\",\n\t\"frequent\",\n\t\"fully\",\n\t\"general\",\n\t\"generous\",\n\t\"gladly\",\n\t\"graceful\",\n\t\"grateful\",\n\t\"gratis\",\n\t\"half\",\n\t\"happily\",\n\t\"hard\",\n\t\"harsh\",\n\t\"hearty\",\n\t\"helpless\",\n\t\"here\",\n\t\"highly\",\n\t\"hitherto\",\n\t\"how\",\n\t\"however\",\n\t\"hurried\",\n\t\"immediate\",\n\t\"in\",\n\t\"indeed\",\n\t\"inland\",\n\t\"innocent\",\n\t\"inside\",\n\t\"instant\",\n\t\"intense\",\n\t\"inward\",\n\t\"jealous\",\n\t\"jovial\",\n\t\"joyful\",\n\t\"jubilant\",\n\t\"keenly\",\n\t\"kindly\",\n\t\"knowing\",\n\t\"lately\",\n\t\"lazily\",\n\t\"lightly\",\n\t\"likely\",\n\t\"little\",\n\t\"live\",\n\t\"loftily\",\n\t\"longing\",\n\t\"loosely\",\n\t\"loudly\",\n\t\"loving\",\n\t\"loyal\",\n\t\"luckily\",\n\t\"madly\",\n\t\"maybe\",\n\t\"meanwhile\",\n\t\"mocking\",\n\t\"monthly\",\n\t\"moreover\",\n\t\"much\",\n\t\"near\",\n\t\"neatly\",\n\t\"neither\",\n\t\"nervous\",\n\t\"never\",\n\t\"noisily\",\n\t\"normal\",\n\t\"not\",\n\t\"now\",\n\t\"nowadays\",\n\t\"nowhere\",\n\t\"oddly\",\n\t\"off\",\n\t\"official\",\n\t\"often\",\n\t\"on\",\n\t\"once\",\n\t\"open\",\n\t\"openly\",\n\t\"opposite\",\n\t\"otherwise\",\n\t\"out\",\n\t\"outside\",\n\t\"over\",\n\t\"overall\",\n\t\"overhead\",\n\t\"overnight\",\n\t\"overseas\",\n\t\"parallel\",\n\t\"partial\",\n\t\"past\",\n\t\"patiently\",\n\t\"perfect\",\n\t\"perhaps\",\n\t\"physical\",\n\t\"playful\",\n\t\"politely\",\n\t\"potential\",\n\t\"powerful\",\n\t\"presto\",\n\t\"profound\",\n\t\"prompt\",\n\t\"proper\",\n\t\"proudly\",\n\t\"punctual\",\n\t\"quickly\",\n\t\"quizzical\",\n\t\"rare\",\n\t\"ravenous\",\n\t\"ready\",\n\t\"really\",\n\t\"reckless\",\n\t\"regular\",\n\t\"repeated\",\n\t\"restful\",\n\t\"rightful\",\n\t\"rigid\",\n\t\"rude\",\n\t\"sadly\",\n\t\"safely\",\n\t\"scarce\",\n\t\"scary\",\n\t\"searching\",\n\t\"seeming\",\n\t\"seldom\",\n\t\"selfish\",\n\t\"separate\",\n\t\"serious\",\n\t\"shaky\",\n\t\"sheepish\",\n\t\"silent\",\n\t\"sleepy\",\n\t\"smooth\",\n\t\"softly\",\n\t\"solemn\",\n\t\"solidly\",\n\t\"sometimes\",\n\t\"speedy\",\n\t\"stealthy\",\n\t\"stern\",\n\t\"strict\",\n\t\"stubborn\",\n\t\"sudden\",\n\t\"supposed\",\n\t\"sweetly\",\n\t\"swiftly\",\n\t\"tender\",\n\t\"tensely\",\n\t\"thankful\",\n\t\"tight\",\n\t\"too\",\n\t\"twice\",\n\t\"under\",\n\t\"untrue\",\n\t\"uphill\",\n\t\"upward\",\n\t\"vaguely\",\n\t\"vainly\",\n\t\"vastly\",\n\t\"warmly\",\n\t\"wearily\",\n\t\"weekly\",\n\t\"well\",\n\t\"wisely\",\n\t\"within\",\n\t\"wrongly\",\n\t\"yonder\",\n];\n\nexport const verbs = [\n\t\"absorb\",\n\t\"accept\",\n\t\"achieve\",\n\t\"adapt\",\n\t\"adore\",\n\t\"advise\",\n\t\"affirm\",\n\t\"agree\",\n\t\"aid\",\n\t\"aim\",\n\t\"amaze\",\n\t\"amuse\",\n\t\"animate\",\n\t\"approve\",\n\t\"arise\",\n\t\"arrive\",\n\t\"ascend\",\n\t\"ask\",\n\t\"aspire\",\n\t\"assure\",\n\t\"attend\",\n\t\"bake\",\n\t\"bask\",\n\t\"beam\",\n\t\"believe\",\n\t\"belong\",\n\t\"bend\",\n\t\"blend\",\n\t\"bless\",\n\t\"blink\",\n\t\"bloom\",\n\t\"boil\",\n\t\"boost\",\n\t\"borrow\",\n\t\"breathe\",\n\t\"bubble\",\n\t\"build\",\n\t\"bump\",\n\t\"burn\",\n\t\"buy\",\n\t\"buzz\",\n\t\"care\",\n\t\"catch\",\n\t\"charm\",\n\t\"cheer\",\n\t\"cherish\",\n\t\"chop\",\n\t\"clap\",\n\t\"clasp\",\n\t\"climb\",\n\t\"clip\",\n\t\"coax\",\n\t\"comfort\",\n\t\"commend\",\n\t\"compose\",\n\t\"conquer\",\n\t\"cook\",\n\t\"create\",\n\t\"cry\",\n\t\"cuddle\",\n\t\"cure\",\n\t\"cut\",\n\t\"dance\",\n\t\"dare\",\n\t\"dart\",\n\t\"dash\",\n\t\"dazzle\",\n\t\"delight\",\n\t\"devour\",\n\t\"dial\",\n\t\"dig\",\n\t\"dine\",\n\t\"dream\",\n\t\"drip\",\n\t\"drop\",\n\t\"drum\",\n\t\"dust\",\n\t\"earn\",\n\t\"edit\",\n\t\"embrace\",\n\t\"emerge\",\n\t\"empower\",\n\t\"enchant\",\n\t\"endure\",\n\t\"engage\",\n\t\"enjoy\",\n\t\"enrich\",\n\t\"evoke\",\n\t\"exhale\",\n\t\"expand\",\n\t\"explore\",\n\t\"express\",\n\t\"fade\",\n\t\"fall\",\n\t\"favor\",\n\t\"fear\",\n\t\"feast\",\n\t\"feel\",\n\t\"fetch\",\n\t\"file\",\n\t\"find\",\n\t\"flip\",\n\t\"flop\",\n\t\"flow\",\n\t\"fold\",\n\t\"fond\",\n\t\"forgive\",\n\t\"foster\",\n\t\"fry\",\n\t\"fulfill\",\n\t\"gasp\",\n\t\"gaze\",\n\t\"gleam\",\n\t\"glow\",\n\t\"grace\",\n\t\"grasp\",\n\t\"greet\",\n\t\"grin\",\n\t\"grip\",\n\t\"grow\",\n\t\"gulp\",\n\t\"hack\",\n\t\"harbor\",\n\t\"heal\",\n\t\"heart\",\n\t\"hike\",\n\t\"hint\",\n\t\"honor\",\n\t\"hope\",\n\t\"hug\",\n\t\"hunt\",\n\t\"hurl\",\n\t\"hush\",\n\t\"imagine\",\n\t\"inspire\",\n\t\"intend\",\n\t\"jest\",\n\t\"jolt\",\n\t\"jump\",\n\t\"kick\",\n\t\"kiss\",\n\t\"laugh\",\n\t\"launch\",\n\t\"lead\",\n\t\"leap\",\n\t\"learn\",\n\t\"lend\",\n\t\"lift\",\n\t\"link\",\n\t\"list\",\n\t\"lock\",\n\t\"loop\",\n\t\"love\",\n\t\"mend\",\n\t\"mix\",\n\t\"mop\",\n\t\"nail\",\n\t\"nourish\",\n\t\"nudge\",\n\t\"nurture\",\n\t\"offer\",\n\t\"pat\",\n\t\"pause\",\n\t\"pave\",\n\t\"peek\",\n\t\"peel\",\n\t\"persist\",\n\t\"pet\",\n\t\"pick\",\n\t\"pinch\",\n\t\"play\",\n\t\"pop\",\n\t\"pout\",\n\t\"praise\",\n\t\"pray\",\n\t\"pride\",\n\t\"promise\",\n\t\"propel\",\n\t\"prosper\",\n\t\"pull\",\n\t\"push\",\n\t\"quell\",\n\t\"quiz\",\n\t\"race\",\n\t\"radiate\",\n\t\"read\",\n\t\"reap\",\n\t\"relish\",\n\t\"renew\",\n\t\"reside\",\n\t\"rest\",\n\t\"revive\",\n\t\"ripple\",\n\t\"rise\",\n\t\"roam\",\n\t\"roar\",\n\t\"rush\",\n\t\"sail\",\n\t\"savor\",\n\t\"scold\",\n\t\"scoop\",\n\t\"seek\",\n\t\"sew\",\n\t\"shine\",\n\t\"sing\",\n\t\"skip\",\n\t\"slide\",\n\t\"slurp\",\n\t\"smile\",\n\t\"snap\",\n\t\"snip\",\n\t\"soar\",\n\t\"spark\",\n\t\"spin\",\n\t\"splash\",\n\t\"sprout\",\n\t\"spur\",\n\t\"stab\",\n\t\"startle\",\n\t\"stir\",\n\t\"stop\",\n\t\"strive\",\n\t\"succeed\",\n\t\"support\",\n\t\"surge\",\n\t\"sway\",\n\t\"swim\",\n\t\"talk\",\n\t\"tap\",\n\t\"taste\",\n\t\"tear\",\n\t\"tend\",\n\t\"thrive\",\n\t\"tickle\",\n\t\"transform\",\n\t\"treasure\",\n\t\"treat\",\n\t\"trim\",\n\t\"trip\",\n\t\"trust\",\n\t\"twirl\",\n\t\"twist\",\n\t\"type\",\n\t\"urge\",\n\t\"value\",\n\t\"vent\",\n\t\"view\",\n\t\"walk\",\n\t\"wave\",\n\t\"win\",\n\t\"wish\",\n\t\"work\",\n\t\"yell\",\n\t\"zap\",\n\t\"zip\",\n\t\"zoom\",\n];\n"],"names":[],"mappings":";;AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,WAAW;IACX,WAAW;IACX,QAAQ;IACR,UAAU;IACV,WAAW;IACX,KAAK;IACL,UAAU;IACV,UAAU;IACV,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,MAAM;IACN,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,WAAW;IACX,MAAM;IACN,QAAQ;IACR,SAAS;IACT,SAAS;IACT,WAAW;IACX,WAAW;IACX,SAAS;IACT,OAAO;IACP,QAAQ;IACR,UAAU;IACV,MAAM;IACN,KAAK;IACL,SAAS;IACT,SAAS;IACT,UAAU;IACV,WAAW;IACX,OAAO;IACP,WAAW;IACX,KAAK;IACL,QAAQ;IACR,KAAK;IACL,SAAS;IACT,QAAQ;IACR,MAAM;IACN,WAAW;IACX,WAAW;IACX,MAAM;IACN,QAAQ;IACR,WAAW;IACX,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,QAAQ;IACR,MAAM;IACN,WAAW;IACX,MAAM;IACN,OAAO;IACP,WAAW;IACX,KAAK;IACL,UAAU;IACV,KAAK;IACL,KAAK;IACL,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,KAAK;IACL,KAAK;IACL,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,OAAO;IACP,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,MAAM;IACN,OAAO;IACP,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,UAAU;IACV,SAAS;IACT,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IAC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ACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;IACN,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;IACV,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,MAAM;CACN,CAAC","debug_id":"e8972a8a-c3a2-5f74-9499-172808f5a618"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.test.d.ts","sourceRoot":"/","sources":["human-id/words.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0396a296-9686-503d-9197-353bc24140ad")}catch(e){}}();
|
|
1
3
|
import { describe, it, expect } from "vitest";
|
|
2
4
|
import { adjectives, animals, adverbs, verbs } from "./words.js";
|
|
3
5
|
const wordlists = [adjectives, animals, adverbs, verbs];
|
|
@@ -23,3 +25,5 @@ describe("wordlists", () => {
|
|
|
23
25
|
}
|
|
24
26
|
});
|
|
25
27
|
});
|
|
28
|
+
//# sourceMappingURL=words.test.js.map
|
|
29
|
+
//# debugId=0396a296-9686-503d-9197-353bc24140ad
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.test.js","sources":["human-id/words.test.ts"],"sourceRoot":"/","sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { adjectives, animals, adverbs, verbs } from \"./words.js\";\n\nconst wordlists = [adjectives, animals, adverbs, verbs];\nconst allwords = [...adjectives, ...animals, ...adverbs, ...verbs];\n\ndescribe(\"wordlists\", () => {\n\tit(\"should have 256 words\", () => {\n\t\tfor (const wordlist of wordlists) {\n\t\t\texpect(wordlist.length).toBe(256);\n\t\t}\n\t});\n\tit(\"words should be unique across lists\", () => {\n\t\tconst unique = new Set(allwords);\n\t\texpect(unique.size).toBe(256 * 4);\n\t});\n\tit(\"words should have < 10 characters\", () => {\n\t\tfor (const word of allwords) {\n\t\t\texpect(word.length).toBeLessThan(10);\n\t\t}\n\t});\n\tit(\"words should match /^[a-z]+$/\", () => {\n\t\tfor (const word of allwords) {\n\t\t\texpect(word.match(/^[a-z]+$/) !== null).toBe(true);\n\t\t}\n\t});\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC;AAEnE,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAChC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;IACF,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC9C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC5C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACtC,CAAC;IACF,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACxC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpD,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","debug_id":"0396a296-9686-503d-9197-353bc24140ad"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
|
+
import type { ProjectSettings } from "../json-schema/settings.js";
|
|
3
|
+
import type { InlangDatabaseSchema } from "../database/schema.js";
|
|
4
|
+
import type { InlangPlugin } from "../plugin/schema.js";
|
|
5
|
+
export declare function exportFiles(opts: {
|
|
6
|
+
readonly pluginKey: string;
|
|
7
|
+
readonly settings: ProjectSettings;
|
|
8
|
+
readonly plugins: readonly InlangPlugin[];
|
|
9
|
+
readonly db: Kysely<InlangDatabaseSchema>;
|
|
10
|
+
}): Promise<import("../index.js").ExportFile[]>;
|
|
11
|
+
//# sourceMappingURL=exportFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportFiles.d.ts","sourceRoot":"/","sources":["import-export/exportFiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC;CAC1C,+CAqBA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bec77b74-fbb4-5eda-87d6-1c11e4009eec")}catch(e){}}();
|
|
3
|
+
import { PluginDoesNotImplementFunctionError, PluginMissingError, } from "../plugin/errors.js";
|
|
4
|
+
export async function exportFiles(opts) {
|
|
5
|
+
const plugin = opts.plugins.find((p) => p.key === opts.pluginKey);
|
|
6
|
+
if (!plugin)
|
|
7
|
+
throw new PluginMissingError({ plugin: opts.pluginKey });
|
|
8
|
+
if (!plugin.exportFiles) {
|
|
9
|
+
throw new PluginDoesNotImplementFunctionError({
|
|
10
|
+
plugin: opts.pluginKey,
|
|
11
|
+
function: "exportFiles",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const bundles = await opts.db.selectFrom("bundle").selectAll().execute();
|
|
15
|
+
const messages = await opts.db.selectFrom("message").selectAll().execute();
|
|
16
|
+
const variants = await opts.db.selectFrom("variant").selectAll().execute();
|
|
17
|
+
const files = await plugin.exportFiles({
|
|
18
|
+
settings: structuredClone(opts.settings),
|
|
19
|
+
bundles,
|
|
20
|
+
messages,
|
|
21
|
+
variants,
|
|
22
|
+
});
|
|
23
|
+
return files;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=exportFiles.js.map
|
|
26
|
+
//# debugId=bec77b74-fbb4-5eda-87d6-1c11e4009eec
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportFiles.js","sources":["import-export/exportFiles.ts"],"sourceRoot":"/","sourcesContent":["import type { Kysely } from \"kysely\";\nimport {\n\tPluginDoesNotImplementFunctionError,\n\tPluginMissingError,\n} from \"../plugin/errors.js\";\nimport type { ProjectSettings } from \"../json-schema/settings.js\";\nimport type { InlangDatabaseSchema } from \"../database/schema.js\";\nimport type { InlangPlugin } from \"../plugin/schema.js\";\n\nexport async function exportFiles(opts: {\n\treadonly pluginKey: string;\n\treadonly settings: ProjectSettings;\n\treadonly plugins: readonly InlangPlugin[];\n\treadonly db: Kysely<InlangDatabaseSchema>;\n}) {\n\tconst plugin = opts.plugins.find((p) => p.key === opts.pluginKey);\n\tif (!plugin) throw new PluginMissingError({ plugin: opts.pluginKey });\n\tif (!plugin.exportFiles) {\n\t\tthrow new PluginDoesNotImplementFunctionError({\n\t\t\tplugin: opts.pluginKey,\n\t\t\tfunction: \"exportFiles\",\n\t\t});\n\t}\n\n\tconst bundles = await opts.db.selectFrom(\"bundle\").selectAll().execute();\n\tconst messages = await opts.db.selectFrom(\"message\").selectAll().execute();\n\tconst variants = await opts.db.selectFrom(\"variant\").selectAll().execute();\n\n\tconst files = await plugin.exportFiles({\n\t\tsettings: structuredClone(opts.settings),\n\t\tbundles,\n\t\tmessages,\n\t\tvariants,\n\t});\n\treturn files;\n}\n"],"names":[],"mappings":";;AACA,OAAO,EACN,mCAAmC,EACnC,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAK7B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAKjC;IACA,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC;IAClE,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACtE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,mCAAmC,CAAC;YAC7C,MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,QAAQ,EAAE,aAAa;SACvB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;IACzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;IAC3E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;IAE3E,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;QACtC,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;QACxC,OAAO;QACP,QAAQ;QACR,QAAQ;KACR,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC","debug_id":"bec77b74-fbb4-5eda-87d6-1c11e4009eec"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
|
+
import type { ProjectSettings } from "../json-schema/settings.js";
|
|
3
|
+
import type { InlangDatabaseSchema } from "../database/schema.js";
|
|
4
|
+
import type { InlangPlugin } from "../plugin/schema.js";
|
|
5
|
+
import type { ImportFile } from "../project/api.js";
|
|
6
|
+
export declare function importFiles(args: {
|
|
7
|
+
files: ImportFile[];
|
|
8
|
+
readonly pluginKey: string;
|
|
9
|
+
readonly settings: ProjectSettings;
|
|
10
|
+
readonly plugins: readonly InlangPlugin[];
|
|
11
|
+
readonly db: Kysely<InlangDatabaseSchema>;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=importFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importFiles.d.ts","sourceRoot":"/","sources":["import-export/importFiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAc,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,wBAAsB,WAAW,CAAC,IAAI,EAAE;IACvC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC;CAC1C,iBA6HA"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0180f00c-8bb4-50a0-a603-1c8f0e7bdcd8")}catch(e){}}();
|
|
3
|
+
import { PluginDoesNotImplementFunctionError, PluginMissingError, } from "../plugin/errors.js";
|
|
4
|
+
export async function importFiles(args) {
|
|
5
|
+
const plugin = args.plugins.find((p) => p.key === args.pluginKey);
|
|
6
|
+
if (!plugin)
|
|
7
|
+
throw new PluginMissingError({ plugin: args.pluginKey });
|
|
8
|
+
if (!plugin.importFiles) {
|
|
9
|
+
throw new PluginDoesNotImplementFunctionError({
|
|
10
|
+
plugin: args.pluginKey,
|
|
11
|
+
function: "importFiles",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const imported = await plugin.importFiles({
|
|
15
|
+
files: args.files,
|
|
16
|
+
settings: structuredClone(args.settings),
|
|
17
|
+
});
|
|
18
|
+
await args.db.transaction().execute(async (trx) => {
|
|
19
|
+
// upsert every bundle
|
|
20
|
+
for (const bundle of imported.bundles) {
|
|
21
|
+
await trx
|
|
22
|
+
.insertInto("bundle")
|
|
23
|
+
.values(bundle)
|
|
24
|
+
.onConflict((oc) => oc.column("id").doUpdateSet(bundle))
|
|
25
|
+
.execute();
|
|
26
|
+
}
|
|
27
|
+
// upsert every message
|
|
28
|
+
for (const message of imported.messages) {
|
|
29
|
+
// match the message by bundle id and locale if
|
|
30
|
+
// no id is provided by the importer
|
|
31
|
+
if (message.id === undefined) {
|
|
32
|
+
const exisingMessage = await trx
|
|
33
|
+
.selectFrom("message")
|
|
34
|
+
.where("bundleId", "=", message.bundleId)
|
|
35
|
+
.where("locale", "=", message.locale)
|
|
36
|
+
.select("id")
|
|
37
|
+
.executeTakeFirst();
|
|
38
|
+
message.id = exisingMessage?.id;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
await trx
|
|
42
|
+
.insertInto("message")
|
|
43
|
+
.values(message)
|
|
44
|
+
.onConflict((oc) => oc.column("id").doUpdateSet(message))
|
|
45
|
+
.execute();
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
// 787 = SQLITE_CONSTRAINT_FOREIGNKEY
|
|
49
|
+
// handle foreign key violation
|
|
50
|
+
// e.g. a message references a bundle that doesn't exist
|
|
51
|
+
// by creating the bundle
|
|
52
|
+
if (e?.resultCode === 787) {
|
|
53
|
+
await trx
|
|
54
|
+
.insertInto("bundle")
|
|
55
|
+
.values({ id: message.bundleId })
|
|
56
|
+
.execute();
|
|
57
|
+
await trx.insertInto("message").values(message).execute();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
throw e;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// upsert every variant
|
|
65
|
+
for (const variant of imported.variants) {
|
|
66
|
+
// match the variant by message id and matches if
|
|
67
|
+
// no id is provided by the importer
|
|
68
|
+
if (variant.id === undefined) {
|
|
69
|
+
let existingMessage = await trx
|
|
70
|
+
.selectFrom("message")
|
|
71
|
+
.where("bundleId", "=", variant.messageBundleId)
|
|
72
|
+
.where("locale", "=", variant.messageLocale)
|
|
73
|
+
.select("id")
|
|
74
|
+
.executeTakeFirst();
|
|
75
|
+
// if the message does not exist, create it
|
|
76
|
+
if (existingMessage === undefined) {
|
|
77
|
+
const existingBundle = await trx
|
|
78
|
+
.selectFrom("bundle")
|
|
79
|
+
.where("id", "=", variant.messageBundleId)
|
|
80
|
+
.select("id")
|
|
81
|
+
.executeTakeFirst();
|
|
82
|
+
// if the bundle does not exist, create it
|
|
83
|
+
if (existingBundle === undefined) {
|
|
84
|
+
await trx
|
|
85
|
+
.insertInto("bundle")
|
|
86
|
+
.values({ id: variant.messageBundleId })
|
|
87
|
+
.execute();
|
|
88
|
+
}
|
|
89
|
+
// insert the message
|
|
90
|
+
existingMessage = await trx
|
|
91
|
+
.insertInto("message")
|
|
92
|
+
.values({
|
|
93
|
+
bundleId: variant.messageBundleId,
|
|
94
|
+
locale: variant.messageLocale,
|
|
95
|
+
})
|
|
96
|
+
.returningAll()
|
|
97
|
+
.executeTakeFirstOrThrow();
|
|
98
|
+
}
|
|
99
|
+
const existingVariants = await trx
|
|
100
|
+
.selectFrom("variant")
|
|
101
|
+
.where("messageId", "=", existingMessage.id)
|
|
102
|
+
.selectAll()
|
|
103
|
+
.execute();
|
|
104
|
+
const existingVariant = existingVariants.find((v) => JSON.stringify(v.matches) === JSON.stringify(variant.matches));
|
|
105
|
+
// need to reset typescript's type narrowing
|
|
106
|
+
variant.id = existingVariant?.id;
|
|
107
|
+
variant.messageId = existingMessage.id;
|
|
108
|
+
}
|
|
109
|
+
const toBeInsertedVariant = {
|
|
110
|
+
...variant,
|
|
111
|
+
// @ts-expect-error - bundle id is provided by VariantImport but not needed when inserting
|
|
112
|
+
messageBundleId: undefined,
|
|
113
|
+
messageLocale: undefined,
|
|
114
|
+
};
|
|
115
|
+
await trx
|
|
116
|
+
.insertInto("variant")
|
|
117
|
+
.values(toBeInsertedVariant)
|
|
118
|
+
.onConflict((oc) => oc.column("id").doUpdateSet(toBeInsertedVariant))
|
|
119
|
+
.execute();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=importFiles.js.map
|
|
124
|
+
//# debugId=0180f00c-8bb4-50a0-a603-1c8f0e7bdcd8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importFiles.js","sources":["import-export/importFiles.ts"],"sourceRoot":"/","sourcesContent":["import type { Kysely } from \"kysely\";\nimport {\n\tPluginDoesNotImplementFunctionError,\n\tPluginMissingError,\n} from \"../plugin/errors.js\";\nimport type { ProjectSettings } from \"../json-schema/settings.js\";\nimport type { InlangDatabaseSchema, NewVariant } from \"../database/schema.js\";\nimport type { InlangPlugin, VariantImport } from \"../plugin/schema.js\";\nimport type { ImportFile } from \"../project/api.js\";\n\nexport async function importFiles(args: {\n\tfiles: ImportFile[];\n\treadonly pluginKey: string;\n\treadonly settings: ProjectSettings;\n\treadonly plugins: readonly InlangPlugin[];\n\treadonly db: Kysely<InlangDatabaseSchema>;\n}) {\n\tconst plugin = args.plugins.find((p) => p.key === args.pluginKey);\n\n\tif (!plugin) throw new PluginMissingError({ plugin: args.pluginKey });\n\n\tif (!plugin.importFiles) {\n\t\tthrow new PluginDoesNotImplementFunctionError({\n\t\t\tplugin: args.pluginKey,\n\t\t\tfunction: \"importFiles\",\n\t\t});\n\t}\n\n\tconst imported = await plugin.importFiles({\n\t\tfiles: args.files,\n\t\tsettings: structuredClone(args.settings),\n\t});\n\n\tawait args.db.transaction().execute(async (trx) => {\n\t\t// upsert every bundle\n\t\tfor (const bundle of imported.bundles) {\n\t\t\tawait trx\n\t\t\t\t.insertInto(\"bundle\")\n\t\t\t\t.values(bundle)\n\t\t\t\t.onConflict((oc) => oc.column(\"id\").doUpdateSet(bundle))\n\t\t\t\t.execute();\n\t\t}\n\t\t// upsert every message\n\t\tfor (const message of imported.messages) {\n\t\t\t// match the message by bundle id and locale if\n\t\t\t// no id is provided by the importer\n\t\t\tif (message.id === undefined) {\n\t\t\t\tconst exisingMessage = await trx\n\t\t\t\t\t.selectFrom(\"message\")\n\t\t\t\t\t.where(\"bundleId\", \"=\", message.bundleId)\n\t\t\t\t\t.where(\"locale\", \"=\", message.locale)\n\t\t\t\t\t.select(\"id\")\n\t\t\t\t\t.executeTakeFirst();\n\t\t\t\tmessage.id = exisingMessage?.id;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait trx\n\t\t\t\t\t.insertInto(\"message\")\n\t\t\t\t\t.values(message)\n\t\t\t\t\t.onConflict((oc) => oc.column(\"id\").doUpdateSet(message))\n\t\t\t\t\t.execute();\n\t\t\t} catch (e) {\n\t\t\t\t// 787 = SQLITE_CONSTRAINT_FOREIGNKEY\n\t\t\t\t// handle foreign key violation\n\t\t\t\t// e.g. a message references a bundle that doesn't exist\n\t\t\t\t// by creating the bundle\n\t\t\t\tif ((e as any)?.resultCode === 787) {\n\t\t\t\t\tawait trx\n\t\t\t\t\t\t.insertInto(\"bundle\")\n\t\t\t\t\t\t.values({ id: message.bundleId })\n\t\t\t\t\t\t.execute();\n\t\t\t\t\tawait trx.insertInto(\"message\").values(message).execute();\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// upsert every variant\n\t\tfor (const variant of imported.variants) {\n\t\t\t// match the variant by message id and matches if\n\t\t\t// no id is provided by the importer\n\t\t\tif (variant.id === undefined) {\n\t\t\t\tlet existingMessage = await trx\n\t\t\t\t\t.selectFrom(\"message\")\n\t\t\t\t\t.where(\"bundleId\", \"=\", variant.messageBundleId)\n\t\t\t\t\t.where(\"locale\", \"=\", variant.messageLocale)\n\t\t\t\t\t.select(\"id\")\n\t\t\t\t\t.executeTakeFirst();\n\n\t\t\t\t// if the message does not exist, create it\n\t\t\t\tif (existingMessage === undefined) {\n\t\t\t\t\tconst existingBundle = await trx\n\t\t\t\t\t\t.selectFrom(\"bundle\")\n\t\t\t\t\t\t.where(\"id\", \"=\", variant.messageBundleId)\n\t\t\t\t\t\t.select(\"id\")\n\t\t\t\t\t\t.executeTakeFirst();\n\t\t\t\t\t// if the bundle does not exist, create it\n\t\t\t\t\tif (existingBundle === undefined) {\n\t\t\t\t\t\tawait trx\n\t\t\t\t\t\t\t.insertInto(\"bundle\")\n\t\t\t\t\t\t\t.values({ id: variant.messageBundleId })\n\t\t\t\t\t\t\t.execute();\n\t\t\t\t\t}\n\t\t\t\t\t// insert the message\n\t\t\t\t\texistingMessage = await trx\n\t\t\t\t\t\t.insertInto(\"message\")\n\t\t\t\t\t\t.values({\n\t\t\t\t\t\t\tbundleId: variant.messageBundleId,\n\t\t\t\t\t\t\tlocale: variant.messageLocale,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.returningAll()\n\t\t\t\t\t\t.executeTakeFirstOrThrow();\n\t\t\t\t}\n\n\t\t\t\tconst existingVariants = await trx\n\t\t\t\t\t.selectFrom(\"variant\")\n\t\t\t\t\t.where(\"messageId\", \"=\", existingMessage.id)\n\t\t\t\t\t.selectAll()\n\t\t\t\t\t.execute();\n\n\t\t\t\tconst existingVariant = existingVariants.find(\n\t\t\t\t\t(v) => JSON.stringify(v.matches) === JSON.stringify(variant.matches)\n\t\t\t\t);\n\n\t\t\t\t// need to reset typescript's type narrowing\n\t\t\t\t(variant as VariantImport).id = existingVariant?.id;\n\t\t\t\t(variant as VariantImport).messageId = existingMessage.id;\n\t\t\t}\n\t\t\tconst toBeInsertedVariant: NewVariant = {\n\t\t\t\t...variant,\n\t\t\t\t// @ts-expect-error - bundle id is provided by VariantImport but not needed when inserting\n\t\t\t\tmessageBundleId: undefined,\n\t\t\t\tmessageLocale: undefined,\n\t\t\t};\n\t\t\tawait trx\n\t\t\t\t.insertInto(\"variant\")\n\t\t\t\t.values(toBeInsertedVariant)\n\t\t\t\t.onConflict((oc) => oc.column(\"id\").doUpdateSet(toBeInsertedVariant))\n\t\t\t\t.execute();\n\t\t}\n\t});\n}\n"],"names":[],"mappings":";;AACA,OAAO,EACN,mCAAmC,EACnC,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAM7B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAMjC;IACA,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC;IAElE,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAEtE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,mCAAmC,CAAC;YAC7C,MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,QAAQ,EAAE,aAAa;SACvB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;QACzC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;KACxC,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,O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