@webiny/api-core-sql 0.0.0-unstable.0d717d18dd → 0.0.0-unstable.292eb6dc15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/TableManager.d.ts +30 -9
  2. package/TableManager.js +36 -12
  3. package/TableManager.js.map +1 -1
  4. package/adminUsers/index.d.ts +3 -0
  5. package/adminUsers/index.js +74 -19
  6. package/adminUsers/index.js.map +1 -1
  7. package/connection/SqlConnectionFeature.d.ts +32 -0
  8. package/connection/SqlConnectionFeature.js +30 -0
  9. package/connection/SqlConnectionFeature.js.map +1 -0
  10. package/connection/index.d.ts +2 -0
  11. package/connection/index.js +1 -0
  12. package/connectionRetry/index.d.ts +3 -0
  13. package/connectionRetry/index.js +2 -0
  14. package/connectionRetry/isConnectionError.d.ts +1 -0
  15. package/connectionRetry/isConnectionError.js +28 -0
  16. package/connectionRetry/isConnectionError.js.map +1 -0
  17. package/connectionRetry/withPgConnectionRetry.d.ts +49 -0
  18. package/connectionRetry/withPgConnectionRetry.js +175 -0
  19. package/connectionRetry/withPgConnectionRetry.js.map +1 -0
  20. package/coreStorage/CoreSqlSchemaSetup.d.ts +18 -0
  21. package/coreStorage/CoreSqlSchemaSetup.js +36 -0
  22. package/coreStorage/CoreSqlSchemaSetup.js.map +1 -0
  23. package/coreStorage/SqlApiCoreStorageOperationsFactory.d.ts +15 -0
  24. package/coreStorage/SqlApiCoreStorageOperationsFactory.js +33 -0
  25. package/coreStorage/SqlApiCoreStorageOperationsFactory.js.map +1 -0
  26. package/coreStorage/SqlTenancyStorageOperationsFactory.d.ts +18 -0
  27. package/coreStorage/SqlTenancyStorageOperationsFactory.js +36 -0
  28. package/coreStorage/SqlTenancyStorageOperationsFactory.js.map +1 -0
  29. package/coreStorage/SqlTenantStorageReadiness.d.ts +19 -0
  30. package/coreStorage/SqlTenantStorageReadiness.js +48 -0
  31. package/coreStorage/SqlTenantStorageReadiness.js.map +1 -0
  32. package/coreStorage/feature.d.ts +14 -0
  33. package/coreStorage/feature.js +17 -0
  34. package/coreStorage/feature.js.map +1 -0
  35. package/coreStorage/index.d.ts +1 -0
  36. package/coreStorage/index.js +1 -0
  37. package/createApiCoreSql.d.ts +19 -1
  38. package/createApiCoreSql.js +12 -10
  39. package/createApiCoreSql.js.map +1 -1
  40. package/feature/SqlDialect/abstractions.d.ts +15 -0
  41. package/feature/SqlDialect/abstractions.js +5 -0
  42. package/feature/SqlDialect/abstractions.js.map +1 -0
  43. package/feature/SqlDialect/index.d.ts +2 -0
  44. package/feature/SqlDialect/index.js +1 -0
  45. package/index.d.ts +26 -4
  46. package/index.js +18 -4
  47. package/index.js.map +1 -1
  48. package/keyValueStore/index.js +160 -21
  49. package/keyValueStore/index.js.map +1 -1
  50. package/package.json +9 -9
  51. package/schemaConfig/abstractions.d.ts +22 -0
  52. package/schemaConfig/abstractions.js +5 -0
  53. package/schemaConfig/abstractions.js.map +1 -0
  54. package/schemaConfig/index.d.ts +1 -0
  55. package/schemaConfig/index.js +1 -0
  56. package/schemaMemory/ensureTable.d.ts +35 -0
  57. package/schemaMemory/ensureTable.js +46 -0
  58. package/schemaMemory/ensureTable.js.map +1 -0
  59. package/schemaMemory/getConnectionKey.d.ts +8 -0
  60. package/schemaMemory/getConnectionKey.js +15 -0
  61. package/schemaMemory/getConnectionKey.js.map +1 -0
  62. package/schemaMemory/getSchemaMemory.d.ts +37 -0
  63. package/schemaMemory/getSchemaMemory.js +53 -0
  64. package/schemaMemory/getSchemaMemory.js.map +1 -0
  65. package/schemaSetup/abstractions.d.ts +79 -0
  66. package/schemaSetup/abstractions.js +6 -0
  67. package/schemaSetup/abstractions.js.map +1 -0
  68. package/schemaSetup/index.d.ts +6 -0
  69. package/schemaSetup/index.js +3 -0
  70. package/schemaSetup/runSchemaSetupSteps.d.ts +43 -0
  71. package/schemaSetup/runSchemaSetupSteps.js +39 -0
  72. package/schemaSetup/runSchemaSetupSteps.js.map +1 -0
  73. package/schemaSetup/runSqlSchemaSetups.d.ts +22 -0
  74. package/schemaSetup/runSqlSchemaSetups.js +24 -0
  75. package/schemaSetup/runSqlSchemaSetups.js.map +1 -0
  76. package/scopeStorage/abstractions.d.ts +19 -0
  77. package/scopeStorage/abstractions.js +5 -0
  78. package/scopeStorage/abstractions.js.map +1 -0
  79. package/scopeStorage/index.d.ts +3 -0
  80. package/scopeStorage/index.js +2 -0
  81. package/scopeStorage/isPostgresScope.d.ts +14 -0
  82. package/scopeStorage/isPostgresScope.js +8 -0
  83. package/scopeStorage/isPostgresScope.js.map +1 -0
  84. package/security/index.d.ts +3 -0
  85. package/security/index.js +68 -47
  86. package/security/index.js.map +1 -1
  87. package/serviceDiscovery/SqlServiceManifestLoader.d.ts +1 -1
  88. package/serviceDiscovery/SqlServiceManifestLoader.js +3 -8
  89. package/serviceDiscovery/SqlServiceManifestLoader.js.map +1 -1
  90. package/serviceDiscovery/SqlServiceManifestWriter.d.ts +16 -0
  91. package/serviceDiscovery/SqlServiceManifestWriter.js +27 -0
  92. package/serviceDiscovery/SqlServiceManifestWriter.js.map +1 -0
  93. package/serviceDiscovery/index.d.ts +1 -0
  94. package/serviceDiscovery/index.js +1 -0
  95. package/serviceDiscovery/serviceManifestsTable.d.ts +13 -0
  96. package/serviceDiscovery/serviceManifestsTable.js +8 -0
  97. package/serviceDiscovery/serviceManifestsTable.js.map +1 -0
  98. package/storage/sqlTenantStorage.d.ts +44 -0
  99. package/storage/sqlTenantStorage.js +32 -0
  100. package/storage/sqlTenantStorage.js.map +1 -0
  101. package/storage/types.d.ts +31 -0
  102. package/storage/types.js +0 -0
  103. package/tenancy/index.js +59 -17
  104. package/tenancy/index.js.map +1 -1
  105. package/ApiCoreSqlFeature.d.ts +0 -13
  106. package/ApiCoreSqlFeature.js +0 -17
  107. package/ApiCoreSqlFeature.js.map +0 -1
@@ -0,0 +1,37 @@
1
+ /**
2
+ * What this process knows about some tables: whether they were created, and a set of names it has
3
+ * checked (tables, tenants). Shared by every caller that asks for the same key, so it outlives the
4
+ * instance that learned it. The Postgres CMS and folder catalog are registered per request (they
5
+ * come with the project's extensions), so each request builds new instances: what they learn about
6
+ * the tables must live here, for the process.
7
+ */
8
+ export interface ISchemaMemory {
9
+ /** What the memory is of: the key it was asked for with. */
10
+ readonly key: string;
11
+ /**
12
+ * Runs `create` once per process; callers at the same time wait for the same run. A failed run is
13
+ * forgotten, so the next call tries again.
14
+ */
15
+ once(create: () => Promise<void>): Promise<void>;
16
+ /** Whether the tables are known to exist (`once` succeeded, or `markReady` was called). */
17
+ isReady(): boolean;
18
+ /** Records that the tables exist (created in a caller's transaction that has committed). */
19
+ markReady(): void;
20
+ /** Names this process has checked (tables, tenants). */
21
+ readonly known: Set<string>;
22
+ /**
23
+ * Goes up on every `reset()`. Work that started before a reset must not record what it learned
24
+ * after it: compare the value taken at the start with the current one.
25
+ */
26
+ readonly generation: number;
27
+ /** Forgets everything (test setups drop all tables between tests). */
28
+ reset(): void;
29
+ }
30
+ /**
31
+ * The process's memory for `key` (a table name, or a name that stands for a set of tables). Made on
32
+ * first use, with `onReset` run whenever it is reset; later callers get the same one.
33
+ *
34
+ * Each memory joins `globalThis.__sqlTableManagers` once, so test setups that drop all tables and
35
+ * call `reset()` on every entry reset it too.
36
+ */
37
+ export declare function getSchemaMemory(key: string, onReset?: () => void): ISchemaMemory;
@@ -0,0 +1,53 @@
1
+ class SchemaMemory {
2
+ constructor(key, onReset){
3
+ this.key = key;
4
+ this.onReset = onReset;
5
+ this.known = new Set();
6
+ this.ready = false;
7
+ this.currentGeneration = 0;
8
+ }
9
+ once(create) {
10
+ if (this.ready) return Promise.resolve();
11
+ if (this.pending) return this.pending;
12
+ const generation = this.currentGeneration;
13
+ const run = create().then(()=>{
14
+ if (this.currentGeneration === generation) this.ready = true;
15
+ }, (error)=>{
16
+ if (this.pending === run) this.pending = void 0;
17
+ throw error;
18
+ });
19
+ this.pending = run;
20
+ return run;
21
+ }
22
+ get generation() {
23
+ return this.currentGeneration;
24
+ }
25
+ isReady() {
26
+ return this.ready;
27
+ }
28
+ markReady() {
29
+ this.ready = true;
30
+ }
31
+ reset() {
32
+ this.currentGeneration += 1;
33
+ this.pending = void 0;
34
+ this.ready = false;
35
+ this.known.clear();
36
+ this.onReset?.();
37
+ }
38
+ }
39
+ const memories = new Map();
40
+ function getSchemaMemory(key, onReset) {
41
+ let memory = memories.get(key);
42
+ if (!memory) {
43
+ memory = new SchemaMemory(key, onReset);
44
+ memories.set(key, memory);
45
+ const g = globalThis;
46
+ const managers = g.__sqlTableManagers ??= [];
47
+ managers.push(memory);
48
+ }
49
+ return memory;
50
+ }
51
+ export { getSchemaMemory };
52
+
53
+ //# sourceMappingURL=getSchemaMemory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaMemory/getSchemaMemory.js","sources":["../../src/schemaMemory/getSchemaMemory.ts"],"sourcesContent":["/**\n * What this process knows about some tables: whether they were created, and a set of names it has\n * checked (tables, tenants). Shared by every caller that asks for the same key, so it outlives the\n * instance that learned it. The Postgres CMS and folder catalog are registered per request (they\n * come with the project's extensions), so each request builds new instances: what they learn about\n * the tables must live here, for the process.\n */\nexport interface ISchemaMemory {\n /** What the memory is of: the key it was asked for with. */\n readonly key: string;\n /**\n * Runs `create` once per process; callers at the same time wait for the same run. A failed run is\n * forgotten, so the next call tries again.\n */\n once(create: () => Promise<void>): Promise<void>;\n /** Whether the tables are known to exist (`once` succeeded, or `markReady` was called). */\n isReady(): boolean;\n /** Records that the tables exist (created in a caller's transaction that has committed). */\n markReady(): void;\n /** Names this process has checked (tables, tenants). */\n readonly known: Set<string>;\n /**\n * Goes up on every `reset()`. Work that started before a reset must not record what it learned\n * after it: compare the value taken at the start with the current one.\n */\n readonly generation: number;\n /** Forgets everything (test setups drop all tables between tests). */\n reset(): void;\n}\n\nclass SchemaMemory implements ISchemaMemory {\n public readonly known = new Set<string>();\n private pending?: Promise<void>;\n private ready = false;\n private currentGeneration = 0;\n\n public constructor(\n public readonly key: string,\n private readonly onReset?: () => void\n ) {}\n\n public once(create: () => Promise<void>): Promise<void> {\n if (this.ready) {\n return Promise.resolve();\n }\n if (this.pending) {\n return this.pending;\n }\n // A run that ends after a reset() must neither mark the tables ready nor clear a newer run.\n const generation = this.currentGeneration;\n const run: Promise<void> = create().then(\n () => {\n if (this.currentGeneration === generation) {\n this.ready = true;\n }\n },\n error => {\n if (this.pending === run) {\n this.pending = undefined;\n }\n throw error;\n }\n );\n this.pending = run;\n return run;\n }\n\n public get generation(): number {\n return this.currentGeneration;\n }\n\n public isReady(): boolean {\n return this.ready;\n }\n\n public markReady(): void {\n this.ready = true;\n }\n\n public reset(): void {\n this.currentGeneration += 1;\n this.pending = undefined;\n this.ready = false;\n this.known.clear();\n this.onReset?.();\n }\n}\n\nconst memories = new Map<string, SchemaMemory>();\n\n/**\n * The process's memory for `key` (a table name, or a name that stands for a set of tables). Made on\n * first use, with `onReset` run whenever it is reset; later callers get the same one.\n *\n * Each memory joins `globalThis.__sqlTableManagers` once, so test setups that drop all tables and\n * call `reset()` on every entry reset it too.\n */\nexport function getSchemaMemory(key: string, onReset?: () => void): ISchemaMemory {\n let memory = memories.get(key);\n if (!memory) {\n memory = new SchemaMemory(key, onReset);\n memories.set(key, memory);\n const g = globalThis as Record<string, unknown>;\n const managers = (g.__sqlTableManagers ??= []) as ISchemaMemory[];\n managers.push(memory);\n }\n return memory;\n}\n"],"names":["SchemaMemory","key","onReset","Set","create","Promise","generation","run","error","undefined","memories","Map","getSchemaMemory","memory","g","globalThis","managers"],"mappings":"AA8BA,MAAMA;IAMF,YACoBC,GAAW,EACVC,OAAoB,CACvC;aAFkBD,GAAG,GAAHA;aACCC,OAAO,GAAPA;aAPL,KAAK,GAAG,IAAIC;aAEpB,KAAK,GAAG;aACR,iBAAiB,GAAG;IAKzB;IAEI,KAAKC,MAA2B,EAAiB;QACpD,IAAI,IAAI,CAAC,KAAK,EACV,OAAOC,QAAQ,OAAO;QAE1B,IAAI,IAAI,CAAC,OAAO,EACZ,OAAO,IAAI,CAAC,OAAO;QAGvB,MAAMC,aAAa,IAAI,CAAC,iBAAiB;QACzC,MAAMC,MAAqBH,SAAS,IAAI,CACpC;YACI,IAAI,IAAI,CAAC,iBAAiB,KAAKE,YAC3B,IAAI,CAAC,KAAK,GAAG;QAErB,GACAE,CAAAA;YACI,IAAI,IAAI,CAAC,OAAO,KAAKD,KACjB,IAAI,CAAC,OAAO,GAAGE;YAEnB,MAAMD;QACV;QAEJ,IAAI,CAAC,OAAO,GAAGD;QACf,OAAOA;IACX;IAEA,IAAW,aAAqB;QAC5B,OAAO,IAAI,CAAC,iBAAiB;IACjC;IAEO,UAAmB;QACtB,OAAO,IAAI,CAAC,KAAK;IACrB;IAEO,YAAkB;QACrB,IAAI,CAAC,KAAK,GAAG;IACjB;IAEO,QAAc;QACjB,IAAI,CAAC,iBAAiB,IAAI;QAC1B,IAAI,CAAC,OAAO,GAAGE;QACf,IAAI,CAAC,KAAK,GAAG;QACb,IAAI,CAAC,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,OAAO;IAChB;AACJ;AAEA,MAAMC,WAAW,IAAIC;AASd,SAASC,gBAAgBX,GAAW,EAAEC,OAAoB;IAC7D,IAAIW,SAASH,SAAS,GAAG,CAACT;IAC1B,IAAI,CAACY,QAAQ;QACTA,SAAS,IAAIb,aAAaC,KAAKC;QAC/BQ,SAAS,GAAG,CAACT,KAAKY;QAClB,MAAMC,IAAIC;QACV,MAAMC,WAAYF,EAAE,kBAAkB,KAAK,EAAE;QAC7CE,SAAS,IAAI,CAACH;IAClB;IACA,OAAOA;AACX"}
@@ -0,0 +1,79 @@
1
+ import type { Knex } from "knex";
2
+ import type { Container } from "@webiny/feature/api";
3
+ import type { TenantStorageBackend } from "@webiny/api-core/features/tenancy/TenantStorages/abstractions.js";
4
+ export interface ISqlSchemaSetup {
5
+ /**
6
+ * What the step sets up, as a short id (`core`, `websockets`, `cms`, `aco`). The runner reports
7
+ * the steps it ran by these names, and can check that a module it needs registered its step.
8
+ */
9
+ readonly name: string;
10
+ /**
11
+ * Brings the step's tables, indexes and functions up to date, whatever the schema-managed
12
+ * setting. Safe to run again: what already exists is kept. It never drops a table or a column,
13
+ * but a step may migrate in place. The Postgres CMS, for one, adds columns
14
+ * (`ALTER TABLE … ADD COLUMN IF NOT EXISTS`), changes column statistics, replaces its trigger
15
+ * functions, replaces the old count triggers and rebuilds the count rows from the search table
16
+ * once. The database user that runs setup needs the rights for that.
17
+ */
18
+ setup(): Promise<void>;
19
+ }
20
+ /**
21
+ * One step of the schema setup. Every part that owns tables registers its own step in a request's
22
+ * container: the storage's parts (core, audit logs, websockets), the transport's login storage, and
23
+ * the modules registered through the project's extensions (the Postgres CMS, the folder catalog).
24
+ * The setup runner runs every step it finds, so it doesn't need to know which modules exist.
25
+ */
26
+ export declare const SqlSchemaSetup: import("@webiny/di").Abstraction<ISqlSchemaSetup>;
27
+ export declare namespace SqlSchemaSetup {
28
+ type Interface = ISqlSchemaSetup;
29
+ }
30
+ export interface ISqlSchemaSetupRequestOptions {
31
+ /**
32
+ * The storage to register, as a tenant scope on it would: an extra storage's backend, bound to
33
+ * the setup's connection. Default: the default storage's.
34
+ */
35
+ backend?: TenantStorageBackend.Interface;
36
+ }
37
+ /**
38
+ * What a request registers, as the transport builds every request's container: its storages (every
39
+ * `RequestStorage`), the API's features and the project's extensions. The schema setup builds its
40
+ * container with it, so it sets up exactly the tables the API uses, with their settings.
41
+ */
42
+ export interface ISqlSchemaSetupRequest {
43
+ register(container: Container, options?: ISqlSchemaSetupRequestOptions): Promise<void>;
44
+ }
45
+ export interface SqlSchemaSetupRunParams {
46
+ /** Registers a request's parts in the setup's container. */
47
+ request: ISqlSchemaSetupRequest;
48
+ /**
49
+ * The connection to set the schema up on. Defaults to the storage's. The caller closes it.
50
+ * On Lambda, setup goes to the database's writer, not through the proxy the API uses.
51
+ */
52
+ knex?: Knex;
53
+ }
54
+ export interface ISqlSchemaSetupRunner {
55
+ /** The id of the storage it sets up: `default`, or an extra storage's. Default: `default`. */
56
+ readonly storage?: string;
57
+ /**
58
+ * Creates every table, index and function the API uses: opens the setup's transaction (on
59
+ * Postgres, behind an advisory lock), builds a container on it the way a request's is built,
60
+ * and runs every `SqlSchemaSetup` step in it. Keeps what exists, and is safe to run on every
61
+ * start or deploy (see `ISqlSchemaSetup.setup` for what a step may migrate). Afterwards the storage is schema-managed. Returns the names of the steps it
62
+ * ran.
63
+ */
64
+ run(params: SqlSchemaSetupRunParams): Promise<string[]>;
65
+ }
66
+ /**
67
+ * Runs the schema setup of one SQL storage. Each storage registers its implementation in the root,
68
+ * the default storage and every extra one (`runSqlSchemaSetups` runs them all):
69
+ * it knows how its engine runs DDL safely (a transaction behind an advisory lock on Postgres, a plain
70
+ * transaction on SQLite) and which modules it can't run without. The transport runs it before the
71
+ * API takes traffic: the standalone server at start, the Lambda API on its schema-setup event.
72
+ */
73
+ export declare const SqlSchemaSetupRunner: import("@webiny/di").Abstraction<ISqlSchemaSetupRunner>;
74
+ export declare namespace SqlSchemaSetupRunner {
75
+ type Interface = ISqlSchemaSetupRunner;
76
+ type Request = ISqlSchemaSetupRequest;
77
+ type RequestOptions = ISqlSchemaSetupRequestOptions;
78
+ type RunParams = SqlSchemaSetupRunParams;
79
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const SqlSchemaSetup = createAbstraction("Db/Sql/SchemaSetup");
3
+ const SqlSchemaSetupRunner = createAbstraction("Db/Sql/SchemaSetupRunner");
4
+ export { SqlSchemaSetup, SqlSchemaSetupRunner };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaSetup/abstractions.js","sources":["../../src/schemaSetup/abstractions.ts"],"sourcesContent":["import type { Knex } from \"knex\";\nimport type { Container } from \"@webiny/feature/api\";\nimport { createAbstraction } from \"@webiny/feature/api\";\n// A deep import: the package root pulls in all of api-core.\nimport type { TenantStorageBackend } from \"@webiny/api-core/features/tenancy/TenantStorages/abstractions.js\";\n\nexport interface ISqlSchemaSetup {\n /**\n * What the step sets up, as a short id (`core`, `websockets`, `cms`, `aco`). The runner reports\n * the steps it ran by these names, and can check that a module it needs registered its step.\n */\n readonly name: string;\n /**\n * Brings the step's tables, indexes and functions up to date, whatever the schema-managed\n * setting. Safe to run again: what already exists is kept. It never drops a table or a column,\n * but a step may migrate in place. The Postgres CMS, for one, adds columns\n * (`ALTER TABLE … ADD COLUMN IF NOT EXISTS`), changes column statistics, replaces its trigger\n * functions, replaces the old count triggers and rebuilds the count rows from the search table\n * once. The database user that runs setup needs the rights for that.\n */\n setup(): Promise<void>;\n}\n\n/**\n * One step of the schema setup. Every part that owns tables registers its own step in a request's\n * container: the storage's parts (core, audit logs, websockets), the transport's login storage, and\n * the modules registered through the project's extensions (the Postgres CMS, the folder catalog).\n * The setup runner runs every step it finds, so it doesn't need to know which modules exist.\n */\nexport const SqlSchemaSetup = createAbstraction<ISqlSchemaSetup>(\"Db/Sql/SchemaSetup\");\n\nexport namespace SqlSchemaSetup {\n export type Interface = ISqlSchemaSetup;\n}\n\nexport interface ISqlSchemaSetupRequestOptions {\n /**\n * The storage to register, as a tenant scope on it would: an extra storage's backend, bound to\n * the setup's connection. Default: the default storage's.\n */\n backend?: TenantStorageBackend.Interface;\n}\n\n/**\n * What a request registers, as the transport builds every request's container: its storages (every\n * `RequestStorage`), the API's features and the project's extensions. The schema setup builds its\n * container with it, so it sets up exactly the tables the API uses, with their settings.\n */\nexport interface ISqlSchemaSetupRequest {\n register(container: Container, options?: ISqlSchemaSetupRequestOptions): Promise<void>;\n}\n\nexport interface SqlSchemaSetupRunParams {\n /** Registers a request's parts in the setup's container. */\n request: ISqlSchemaSetupRequest;\n /**\n * The connection to set the schema up on. Defaults to the storage's. The caller closes it.\n * On Lambda, setup goes to the database's writer, not through the proxy the API uses.\n */\n knex?: Knex;\n}\n\nexport interface ISqlSchemaSetupRunner {\n /** The id of the storage it sets up: `default`, or an extra storage's. Default: `default`. */\n readonly storage?: string;\n /**\n * Creates every table, index and function the API uses: opens the setup's transaction (on\n * Postgres, behind an advisory lock), builds a container on it the way a request's is built,\n * and runs every `SqlSchemaSetup` step in it. Keeps what exists, and is safe to run on every\n * start or deploy (see `ISqlSchemaSetup.setup` for what a step may migrate). Afterwards the storage is schema-managed. Returns the names of the steps it\n * ran.\n */\n run(params: SqlSchemaSetupRunParams): Promise<string[]>;\n}\n\n/**\n * Runs the schema setup of one SQL storage. Each storage registers its implementation in the root,\n * the default storage and every extra one (`runSqlSchemaSetups` runs them all):\n * it knows how its engine runs DDL safely (a transaction behind an advisory lock on Postgres, a plain\n * transaction on SQLite) and which modules it can't run without. The transport runs it before the\n * API takes traffic: the standalone server at start, the Lambda API on its schema-setup event.\n */\nexport const SqlSchemaSetupRunner = createAbstraction<ISqlSchemaSetupRunner>(\n \"Db/Sql/SchemaSetupRunner\"\n);\n\nexport namespace SqlSchemaSetupRunner {\n export type Interface = ISqlSchemaSetupRunner;\n export type Request = ISqlSchemaSetupRequest;\n export type RequestOptions = ISqlSchemaSetupRequestOptions;\n export type RunParams = SqlSchemaSetupRunParams;\n}\n"],"names":["SqlSchemaSetup","createAbstraction","SqlSchemaSetupRunner"],"mappings":";AA6BO,MAAMA,iBAAiBC,kBAAmC;AAqD1D,MAAMC,uBAAuBD,kBAChC"}
@@ -0,0 +1,6 @@
1
+ export { SqlSchemaSetup, SqlSchemaSetupRunner } from "./abstractions.js";
2
+ export type { ISqlSchemaSetupRequest, ISqlSchemaSetupRequestOptions, SqlSchemaSetupRunParams } from "./abstractions.js";
3
+ export { runSqlSchemaSetups } from "./runSqlSchemaSetups.js";
4
+ export type { RunSqlSchemaSetupsParams, SqlSchemaSetupResult } from "./runSqlSchemaSetups.js";
5
+ export { runSchemaSetupSteps } from "./runSchemaSetupSteps.js";
6
+ export type { RequiredSqlSchemaSetup, RunSchemaSetupStepsParams } from "./runSchemaSetupSteps.js";
@@ -0,0 +1,3 @@
1
+ export { SqlSchemaSetup, SqlSchemaSetupRunner } from "./abstractions.js";
2
+ export { runSqlSchemaSetups } from "./runSqlSchemaSetups.js";
3
+ export { runSchemaSetupSteps } from "./runSchemaSetupSteps.js";
@@ -0,0 +1,43 @@
1
+ import type { Knex } from "knex";
2
+ import type { Container } from "@webiny/feature/api";
3
+ import type { SqlDialect } from "../feature/SqlDialect/index.js";
4
+ import type { TenantStorageBackend } from "@webiny/api-core/features/tenancy/TenantStorages/abstractions.js";
5
+ import { type ISqlSchemaSetupRequest } from "./abstractions.js";
6
+ export interface RequiredSqlSchemaSetup {
7
+ /** The step's name (`SqlSchemaSetup.name`). */
8
+ name: string;
9
+ /** The error when no step of that name is registered: what to add to the project. */
10
+ message: string;
11
+ }
12
+ export interface RunSchemaSetupStepsParams {
13
+ /** The root container the storage is registered in. The setup's container is its child. */
14
+ root: Container;
15
+ /** The setup's connection: a transaction the runner opened. */
16
+ knex: Knex;
17
+ /** The connection's database family. */
18
+ dialect: SqlDialect.Name;
19
+ tableNamePrefix?: string;
20
+ /** Registers a request's parts in the setup's container. */
21
+ request: ISqlSchemaSetupRequest;
22
+ /** Steps the storage can't run without (a module the project must add). */
23
+ required?: RequiredSqlSchemaSetup[];
24
+ /**
25
+ * An extra storage's backend, bound to the setup's connection: the request registers it instead
26
+ * of the default storage's, so the setup creates the tables of the parts a scope on it has.
27
+ */
28
+ backend?: TenantStorageBackend.Interface;
29
+ }
30
+ /**
31
+ * The part of schema setup every SQL storage shares, run inside the runner's transaction. It builds
32
+ * a container on the setup's connection the way a request's is built, and runs every schema setup
33
+ * step in it.
34
+ *
35
+ * The container is a child of the root, so it has what a request has (the logger, the storages'
36
+ * `RequestStorage`). The setup's connection is registered in it first, with schema-managed off:
37
+ * every storage the request registers runs on it, including the ones built while the request
38
+ * registers and the modules' singletons, which are built in the container that registers them.
39
+ *
40
+ * Checks `required` before running anything, so a missing module fails before any DDL. Returns the
41
+ * names of the steps it ran, in order.
42
+ */
43
+ export declare function runSchemaSetupSteps(params: RunSchemaSetupStepsParams): Promise<string[]>;
@@ -0,0 +1,39 @@
1
+ import { SqlConnectionFeature } from "../connection/SqlConnectionFeature.js";
2
+ import { SqlSchemaSetup } from "./abstractions.js";
3
+ async function runSchemaSetupSteps(params) {
4
+ const { root, knex, dialect, tableNamePrefix, request, required = [], backend } = params;
5
+ const container = root.createChildContainer();
6
+ SqlConnectionFeature.register(container, {
7
+ knex,
8
+ dialect,
9
+ tableNamePrefix,
10
+ schemaManaged: false
11
+ });
12
+ if (backend) await request.register(container, {
13
+ backend
14
+ });
15
+ else await request.register(container);
16
+ const steps = resolveSteps(container, required);
17
+ for (const step of required)if (!steps.some((item)=>item.name === step.name)) throw new Error(step.message);
18
+ const done = [];
19
+ for (const step of steps){
20
+ await step.setup();
21
+ done.push(step.name);
22
+ }
23
+ return done;
24
+ }
25
+ function resolveSteps(container, required) {
26
+ try {
27
+ return container.resolveAll(SqlSchemaSetup);
28
+ } catch (error) {
29
+ if (!required.length) throw error;
30
+ const cause = error instanceof Error ? error.message : String(error);
31
+ const needs = required.map((step)=>step.message).join(" ");
32
+ throw new Error(`Schema setup could not build its steps (${cause}). ${needs}`, {
33
+ cause: error
34
+ });
35
+ }
36
+ }
37
+ export { runSchemaSetupSteps };
38
+
39
+ //# sourceMappingURL=runSchemaSetupSteps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaSetup/runSchemaSetupSteps.js","sources":["../../src/schemaSetup/runSchemaSetupSteps.ts"],"sourcesContent":["import type { Knex } from \"knex\";\nimport type { Container } from \"@webiny/feature/api\";\nimport { SqlConnectionFeature } from \"~/connection/SqlConnectionFeature.js\";\nimport type { SqlDialect } from \"~/feature/SqlDialect/index.js\";\nimport type { TenantStorageBackend } from \"@webiny/api-core/features/tenancy/TenantStorages/abstractions.js\";\nimport { SqlSchemaSetup, type ISqlSchemaSetupRequest } from \"./abstractions.js\";\n\nexport interface RequiredSqlSchemaSetup {\n /** The step's name (`SqlSchemaSetup.name`). */\n name: string;\n /** The error when no step of that name is registered: what to add to the project. */\n message: string;\n}\n\nexport interface RunSchemaSetupStepsParams {\n /** The root container the storage is registered in. The setup's container is its child. */\n root: Container;\n /** The setup's connection: a transaction the runner opened. */\n knex: Knex;\n /** The connection's database family. */\n dialect: SqlDialect.Name;\n tableNamePrefix?: string;\n /** Registers a request's parts in the setup's container. */\n request: ISqlSchemaSetupRequest;\n /** Steps the storage can't run without (a module the project must add). */\n required?: RequiredSqlSchemaSetup[];\n /**\n * An extra storage's backend, bound to the setup's connection: the request registers it instead\n * of the default storage's, so the setup creates the tables of the parts a scope on it has.\n */\n backend?: TenantStorageBackend.Interface;\n}\n\n/**\n * The part of schema setup every SQL storage shares, run inside the runner's transaction. It builds\n * a container on the setup's connection the way a request's is built, and runs every schema setup\n * step in it.\n *\n * The container is a child of the root, so it has what a request has (the logger, the storages'\n * `RequestStorage`). The setup's connection is registered in it first, with schema-managed off:\n * every storage the request registers runs on it, including the ones built while the request\n * registers and the modules' singletons, which are built in the container that registers them.\n *\n * Checks `required` before running anything, so a missing module fails before any DDL. Returns the\n * names of the steps it ran, in order.\n */\nexport async function runSchemaSetupSteps(params: RunSchemaSetupStepsParams): Promise<string[]> {\n const { root, knex, dialect, tableNamePrefix, request, required = [], backend } = params;\n\n const container = root.createChildContainer();\n SqlConnectionFeature.register(container, {\n knex,\n dialect,\n tableNamePrefix,\n schemaManaged: false\n });\n if (backend) {\n await request.register(container, { backend });\n } else {\n await request.register(container);\n }\n\n const steps = resolveSteps(container, required);\n for (const step of required) {\n if (!steps.some(item => item.name === step.name)) {\n throw new Error(step.message);\n }\n }\n\n const done: string[] = [];\n for (const step of steps) {\n await step.setup();\n done.push(step.name);\n }\n return done;\n}\n\n/**\n * Builds the steps. A step whose module needs another one that is missing (the folder catalog needs\n * the CMS's table names) can't be built, and that fails before any step has a name to check. So\n * the failure says which modules the storage needs, with the cause.\n */\nfunction resolveSteps(container: Container, required: RequiredSqlSchemaSetup[]) {\n try {\n return container.resolveAll(SqlSchemaSetup);\n } catch (error) {\n if (!required.length) {\n throw error;\n }\n const cause = error instanceof Error ? error.message : String(error);\n const needs = required.map(step => step.message).join(\" \");\n throw new Error(`Schema setup could not build its steps (${cause}). ${needs}`, {\n cause: error\n });\n }\n}\n"],"names":["runSchemaSetupSteps","params","root","knex","dialect","tableNamePrefix","request","required","backend","container","SqlConnectionFeature","steps","resolveSteps","step","item","Error","done","SqlSchemaSetup","error","cause","String","needs"],"mappings":";;AA8CO,eAAeA,oBAAoBC,MAAiC;IACvE,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,eAAe,EAAEC,OAAO,EAAEC,WAAW,EAAE,EAAEC,OAAO,EAAE,GAAGP;IAElF,MAAMQ,YAAYP,KAAK,oBAAoB;IAC3CQ,qBAAqB,QAAQ,CAACD,WAAW;QACrCN;QACAC;QACAC;QACA,eAAe;IACnB;IACA,IAAIG,SACA,MAAMF,QAAQ,QAAQ,CAACG,WAAW;QAAED;IAAQ;SAE5C,MAAMF,QAAQ,QAAQ,CAACG;IAG3B,MAAME,QAAQC,aAAaH,WAAWF;IACtC,KAAK,MAAMM,QAAQN,SACf,IAAI,CAACI,MAAM,IAAI,CAACG,CAAAA,OAAQA,KAAK,IAAI,KAAKD,KAAK,IAAI,GAC3C,MAAM,IAAIE,MAAMF,KAAK,OAAO;IAIpC,MAAMG,OAAiB,EAAE;IACzB,KAAK,MAAMH,QAAQF,MAAO;QACtB,MAAME,KAAK,KAAK;QAChBG,KAAK,IAAI,CAACH,KAAK,IAAI;IACvB;IACA,OAAOG;AACX;AAOA,SAASJ,aAAaH,SAAoB,EAAEF,QAAkC;IAC1E,IAAI;QACA,OAAOE,UAAU,UAAU,CAACQ;IAChC,EAAE,OAAOC,OAAO;QACZ,IAAI,CAACX,SAAS,MAAM,EAChB,MAAMW;QAEV,MAAMC,QAAQD,iBAAiBH,QAAQG,MAAM,OAAO,GAAGE,OAAOF;QAC9D,MAAMG,QAAQd,SAAS,GAAG,CAACM,CAAAA,OAAQA,KAAK,OAAO,EAAE,IAAI,CAAC;QACtD,MAAM,IAAIE,MAAM,CAAC,wCAAwC,EAAEI,MAAM,GAAG,EAAEE,OAAO,EAAE;YAC3E,OAAOH;QACX;IACJ;AACJ"}
@@ -0,0 +1,22 @@
1
+ import type { Container } from "@webiny/feature/api";
2
+ import { type ISqlSchemaSetupRequest } from "./abstractions.js";
3
+ export interface RunSqlSchemaSetupsParams {
4
+ /** The root container the storages are registered in. */
5
+ root: Container;
6
+ /** Registers a request's parts in each setup's container. */
7
+ request: ISqlSchemaSetupRequest;
8
+ }
9
+ export interface SqlSchemaSetupResult {
10
+ /** The storage's id: `default`, or an extra storage's. */
11
+ storage: string;
12
+ /** The names of the steps its setup ran, in order. */
13
+ steps: string[];
14
+ }
15
+ /**
16
+ * Runs the schema setup of every SQL storage registered in the root: the default storage first, then
17
+ * each extra one in the order it was registered. Each storage's runner opens its own transaction on
18
+ * its own connection (behind its own advisory lock on Postgres), so a storage's setup never waits for
19
+ * another's. The first failure stops the rest: a server must not start with a storage whose tables
20
+ * may be missing.
21
+ */
22
+ export declare function runSqlSchemaSetups(params: RunSqlSchemaSetupsParams): Promise<SqlSchemaSetupResult[]>;
@@ -0,0 +1,24 @@
1
+ import { TenantStorageId } from "@webiny/api-core/features/tenancy/TenantStorages/TenantStorageId.js";
2
+ import { SqlSchemaSetupRunner } from "./abstractions.js";
3
+ async function runSqlSchemaSetups(params) {
4
+ const runners = params.root.resolveAll(SqlSchemaSetupRunner);
5
+ const storageOf = (runner)=>TenantStorageId.from(runner.storage);
6
+ const ordered = [
7
+ ...runners.filter((runner)=>storageOf(runner).isDefault()),
8
+ ...runners.filter((runner)=>!storageOf(runner).isDefault())
9
+ ];
10
+ const results = [];
11
+ for (const runner of ordered){
12
+ const steps = await runner.run({
13
+ request: params.request
14
+ });
15
+ results.push({
16
+ storage: storageOf(runner).toString(),
17
+ steps
18
+ });
19
+ }
20
+ return results;
21
+ }
22
+ export { runSqlSchemaSetups };
23
+
24
+ //# sourceMappingURL=runSqlSchemaSetups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaSetup/runSqlSchemaSetups.js","sources":["../../src/schemaSetup/runSqlSchemaSetups.ts"],"sourcesContent":["import type { Container } from \"@webiny/feature/api\";\nimport { TenantStorageId } from \"@webiny/api-core/features/tenancy/TenantStorages/TenantStorageId.js\";\nimport { SqlSchemaSetupRunner, type ISqlSchemaSetupRequest } from \"./abstractions.js\";\n\nexport interface RunSqlSchemaSetupsParams {\n /** The root container the storages are registered in. */\n root: Container;\n /** Registers a request's parts in each setup's container. */\n request: ISqlSchemaSetupRequest;\n}\n\nexport interface SqlSchemaSetupResult {\n /** The storage's id: `default`, or an extra storage's. */\n storage: string;\n /** The names of the steps its setup ran, in order. */\n steps: string[];\n}\n\n/**\n * Runs the schema setup of every SQL storage registered in the root: the default storage first, then\n * each extra one in the order it was registered. Each storage's runner opens its own transaction on\n * its own connection (behind its own advisory lock on Postgres), so a storage's setup never waits for\n * another's. The first failure stops the rest: a server must not start with a storage whose tables\n * may be missing.\n */\nexport async function runSqlSchemaSetups(\n params: RunSqlSchemaSetupsParams\n): Promise<SqlSchemaSetupResult[]> {\n const runners = params.root.resolveAll(SqlSchemaSetupRunner);\n const storageOf = (runner: SqlSchemaSetupRunner.Interface) => {\n return TenantStorageId.from(runner.storage);\n };\n const ordered = [\n ...runners.filter(runner => storageOf(runner).isDefault()),\n ...runners.filter(runner => !storageOf(runner).isDefault())\n ];\n\n const results: SqlSchemaSetupResult[] = [];\n for (const runner of ordered) {\n const steps = await runner.run({ request: params.request });\n results.push({ storage: storageOf(runner).toString(), steps });\n }\n return results;\n}\n"],"names":["runSqlSchemaSetups","params","runners","SqlSchemaSetupRunner","storageOf","runner","TenantStorageId","ordered","results","steps"],"mappings":";;AAyBO,eAAeA,mBAClBC,MAAgC;IAEhC,MAAMC,UAAUD,OAAO,IAAI,CAAC,UAAU,CAACE;IACvC,MAAMC,YAAY,CAACC,SACRC,gBAAgB,IAAI,CAACD,OAAO,OAAO;IAE9C,MAAME,UAAU;WACTL,QAAQ,MAAM,CAACG,CAAAA,SAAUD,UAAUC,QAAQ,SAAS;WACpDH,QAAQ,MAAM,CAACG,CAAAA,SAAU,CAACD,UAAUC,QAAQ,SAAS;KAC3D;IAED,MAAMG,UAAkC,EAAE;IAC1C,KAAK,MAAMH,UAAUE,QAAS;QAC1B,MAAME,QAAQ,MAAMJ,OAAO,GAAG,CAAC;YAAE,SAASJ,OAAO,OAAO;QAAC;QACzDO,QAAQ,IAAI,CAAC;YAAE,SAASJ,UAAUC,QAAQ,QAAQ;YAAII;QAAM;IAChE;IACA,OAAOD;AACX"}
@@ -0,0 +1,19 @@
1
+ import type { Container } from "@webiny/feature/api";
2
+ export interface ISqlScopeStorage {
3
+ /**
4
+ * Registers a part's storage in a tenant scope on a SQL storage, on the scope's connection and
5
+ * table settings (`KnexClient`, `SqlSchemaConfig`), which the storage registered first.
6
+ */
7
+ register(container: Container): void | Promise<void>;
8
+ }
9
+ /**
10
+ * A part of the API that keeps its data on whichever SQL storage a tenant runs on, added by the
11
+ * transport rather than by the storage: the standalone server's login (credentials, reset codes).
12
+ * Registered in the root, once per process. Every SQL storage, the default and each extra one,
13
+ * registers all of them in each tenant scope it serves, after its own storage parts. A scope on a
14
+ * storage that isn't SQL gets none.
15
+ */
16
+ export declare const SqlScopeStorage: import("@webiny/di").Abstraction<ISqlScopeStorage>;
17
+ export declare namespace SqlScopeStorage {
18
+ type Interface = ISqlScopeStorage;
19
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const SqlScopeStorage = createAbstraction("Db/Sql/ScopeStorage");
3
+ export { SqlScopeStorage };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopeStorage/abstractions.js","sources":["../../src/scopeStorage/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Container } from \"@webiny/feature/api\";\n\nexport interface ISqlScopeStorage {\n /**\n * Registers a part's storage in a tenant scope on a SQL storage, on the scope's connection and\n * table settings (`KnexClient`, `SqlSchemaConfig`), which the storage registered first.\n */\n register(container: Container): void | Promise<void>;\n}\n\n/**\n * A part of the API that keeps its data on whichever SQL storage a tenant runs on, added by the\n * transport rather than by the storage: the standalone server's login (credentials, reset codes).\n * Registered in the root, once per process. Every SQL storage, the default and each extra one,\n * registers all of them in each tenant scope it serves, after its own storage parts. A scope on a\n * storage that isn't SQL gets none.\n */\nexport const SqlScopeStorage = createAbstraction<ISqlScopeStorage>(\"Db/Sql/ScopeStorage\");\n\nexport namespace SqlScopeStorage {\n export type Interface = ISqlScopeStorage;\n}\n"],"names":["SqlScopeStorage","createAbstraction"],"mappings":";AAkBO,MAAMA,kBAAkBC,kBAAoC"}
@@ -0,0 +1,3 @@
1
+ export { SqlScopeStorage } from "./abstractions.js";
2
+ export type { ISqlScopeStorage } from "./abstractions.js";
3
+ export { isPostgresScope } from "./isPostgresScope.js";
@@ -0,0 +1,2 @@
1
+ export { SqlScopeStorage } from "./abstractions.js";
2
+ export { isPostgresScope } from "./isPostgresScope.js";
@@ -0,0 +1,14 @@
1
+ import type { Container } from "@webiny/feature/api";
2
+ /**
3
+ * Whether the container's SQL connection is Postgres: the connection of the tenant scope's storage,
4
+ * or of the schema setup the container was built for. `false` when the container has no SQL
5
+ * connection at all (a scope on DynamoDB).
6
+ *
7
+ * Reads the `SqlDialect` the storage registered with its connection. A scope on an extra storage
8
+ * registers its own over the default storage's in the root, and `resolve` returns the nearest.
9
+ *
10
+ * Modules that only run on Postgres (`<HeadlessCmsPg />`, `<AcoPg />`) come with the project's
11
+ * extensions, which register in every scope. A deploy whose default storage is SQLite or DynamoDB
12
+ * and that declares an extra Postgres storage registers them only where this is `true`.
13
+ */
14
+ export declare function isPostgresScope(container: Container): boolean;
@@ -0,0 +1,8 @@
1
+ import { SqlDialect } from "../feature/SqlDialect/index.js";
2
+ function isPostgresScope(container) {
3
+ if (0 === container.resolveAll(SqlDialect).length) return false;
4
+ return "postgres" === container.resolve(SqlDialect).name;
5
+ }
6
+ export { isPostgresScope };
7
+
8
+ //# sourceMappingURL=isPostgresScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopeStorage/isPostgresScope.js","sources":["../../src/scopeStorage/isPostgresScope.ts"],"sourcesContent":["import type { Container } from \"@webiny/feature/api\";\nimport { SqlDialect } from \"~/feature/SqlDialect/index.js\";\n\n/**\n * Whether the container's SQL connection is Postgres: the connection of the tenant scope's storage,\n * or of the schema setup the container was built for. `false` when the container has no SQL\n * connection at all (a scope on DynamoDB).\n *\n * Reads the `SqlDialect` the storage registered with its connection. A scope on an extra storage\n * registers its own over the default storage's in the root, and `resolve` returns the nearest.\n *\n * Modules that only run on Postgres (`<HeadlessCmsPg />`, `<AcoPg />`) come with the project's\n * extensions, which register in every scope. A deploy whose default storage is SQLite or DynamoDB\n * and that declares an extra Postgres storage registers them only where this is `true`.\n */\nexport function isPostgresScope(container: Container): boolean {\n if (container.resolveAll(SqlDialect).length === 0) {\n return false;\n }\n return container.resolve(SqlDialect).name === \"postgres\";\n}\n"],"names":["isPostgresScope","container","SqlDialect"],"mappings":";AAeO,SAASA,gBAAgBC,SAAoB;IAChD,IAAIA,AAA4C,MAA5CA,UAAU,UAAU,CAACC,YAAY,MAAM,EACvC,OAAO;IAEX,OAAOD,AAAuC,eAAvCA,UAAU,OAAO,CAACC,YAAY,IAAI;AAC7C"}
@@ -1,9 +1,12 @@
1
1
  import type { Knex } from "knex";
2
2
  import type { SecurityStorageOperations } from "@webiny/api-core/types/security.js";
3
+ import type { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
3
4
  import type { TableManager } from "../TableManager.js";
4
5
  interface CreateStorageOperationsParams {
5
6
  knex: Knex;
6
7
  tableManager: TableManager;
8
+ /** The tenant the storage acts on: its scope's. */
9
+ scopeTenant: ScopeTenant.Interface;
7
10
  }
8
11
  export declare const createStorageOperations: (params: CreateStorageOperationsParams) => SecurityStorageOperations;
9
12
  export {};