@ankhorage/infra-supabase 0.0.0-stage → 0.5.16
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/LICENSE +21 -0
- package/README.md +39 -2
- package/dist/constants/infra.d.ts +11 -0
- package/dist/constants/infra.d.ts.map +1 -0
- package/dist/constants/infra.js +4 -0
- package/dist/constants/infra.js.map +1 -0
- package/dist/features/platform-infrastructure/adapters/outbound/createFetchSupabaseControlPlane.d.ts +9 -0
- package/dist/features/platform-infrastructure/adapters/outbound/createFetchSupabaseControlPlane.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/adapters/outbound/createFetchSupabaseControlPlane.js +89 -0
- package/dist/features/platform-infrastructure/adapters/outbound/createFetchSupabaseControlPlane.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/destroySupabaseAsync.d.ts +5 -0
- package/dist/features/platform-infrastructure/application/use-cases/destroySupabaseAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/destroySupabaseAsync.js +64 -0
- package/dist/features/platform-infrastructure/application/use-cases/destroySupabaseAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/getSupabaseStatusAsync.d.ts +5 -0
- package/dist/features/platform-infrastructure/application/use-cases/getSupabaseStatusAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/getSupabaseStatusAsync.js +59 -0
- package/dist/features/platform-infrastructure/application/use-cases/getSupabaseStatusAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/planSupabase.d.ts +4 -0
- package/dist/features/platform-infrastructure/application/use-cases/planSupabase.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/planSupabase.js +37 -0
- package/dist/features/platform-infrastructure/application/use-cases/planSupabase.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/prepareSupabaseBootstrapCredentialsAsync.d.ts +4 -0
- package/dist/features/platform-infrastructure/application/use-cases/prepareSupabaseBootstrapCredentialsAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/prepareSupabaseBootstrapCredentialsAsync.js +63 -0
- package/dist/features/platform-infrastructure/application/use-cases/prepareSupabaseBootstrapCredentialsAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/reconcileSupabaseAsync.d.ts +5 -0
- package/dist/features/platform-infrastructure/application/use-cases/reconcileSupabaseAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/reconcileSupabaseAsync.js +66 -0
- package/dist/features/platform-infrastructure/application/use-cases/reconcileSupabaseAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/resolveSupabaseBootstrapCredentialsAsync.d.ts +5 -0
- package/dist/features/platform-infrastructure/application/use-cases/resolveSupabaseBootstrapCredentialsAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/resolveSupabaseBootstrapCredentialsAsync.js +8 -0
- package/dist/features/platform-infrastructure/application/use-cases/resolveSupabaseBootstrapCredentialsAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.d.ts +4 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.js +26 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabasePersistenceCredentialsAsync.d.ts +4 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabasePersistenceCredentialsAsync.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabasePersistenceCredentialsAsync.js +42 -0
- package/dist/features/platform-infrastructure/application/use-cases/validateSupabasePersistenceCredentialsAsync.js.map +1 -0
- package/dist/features/platform-infrastructure/composition/createInfraAdapter.d.ts +12 -0
- package/dist/features/platform-infrastructure/composition/createInfraAdapter.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/composition/createInfraAdapter.js +37 -0
- package/dist/features/platform-infrastructure/composition/createInfraAdapter.js.map +1 -0
- package/dist/features/platform-infrastructure/constants/databaseBootstrap.d.ts +5 -0
- package/dist/features/platform-infrastructure/constants/databaseBootstrap.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/constants/databaseBootstrap.js +233 -0
- package/dist/features/platform-infrastructure/constants/databaseBootstrap.js.map +1 -0
- package/dist/features/platform-infrastructure/constants/recovery.d.ts +4 -0
- package/dist/features/platform-infrastructure/constants/recovery.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/constants/recovery.js +4 -0
- package/dist/features/platform-infrastructure/constants/recovery.js.map +1 -0
- package/dist/features/platform-infrastructure/constants/supabase.d.ts +18 -0
- package/dist/features/platform-infrastructure/constants/supabase.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/constants/supabase.js +103 -0
- package/dist/features/platform-infrastructure/constants/supabase.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseAuthWorkload.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseAuthWorkload.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseAuthWorkload.js +53 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseAuthWorkload.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseBackupWorkload.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseBackupWorkload.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseBackupWorkload.js +212 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseBackupWorkload.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseDataRestoreWorkload.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseDataRestoreWorkload.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseDataRestoreWorkload.js +111 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseDataRestoreWorkload.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabasePersistence.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabasePersistence.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabasePersistence.js +19 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabasePersistence.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseRestore.d.ts +13 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseRestore.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseRestore.js +147 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseDatabaseRestore.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseOperationalWorkloads.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseOperationalWorkloads.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseOperationalWorkloads.js +103 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseOperationalWorkloads.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseS3Values.d.ts +14 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseS3Values.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseS3Values.js +30 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseS3Values.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseStorageWorkload.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseStorageWorkload.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseStorageWorkload.js +100 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseStorageWorkload.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseWorkloads.d.ts +4 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseWorkloads.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseWorkloads.js +234 -0
- package/dist/features/platform-infrastructure/domain/createSupabaseWorkloads.js.map +1 -0
- package/dist/features/platform-infrastructure/domain/resolveSupabaseDesiredState.d.ts +5 -0
- package/dist/features/platform-infrastructure/domain/resolveSupabaseDesiredState.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/domain/resolveSupabaseDesiredState.js +88 -0
- package/dist/features/platform-infrastructure/domain/resolveSupabaseDesiredState.js.map +1 -0
- package/dist/features/platform-infrastructure/utils/resolveSupabaseControlPlaneUrl.d.ts +4 -0
- package/dist/features/platform-infrastructure/utils/resolveSupabaseControlPlaneUrl.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/utils/resolveSupabaseControlPlaneUrl.js +45 -0
- package/dist/features/platform-infrastructure/utils/resolveSupabaseControlPlaneUrl.js.map +1 -0
- package/dist/features/platform-infrastructure/utils/validateSupabaseBootstrapCredentials.d.ts +5 -0
- package/dist/features/platform-infrastructure/utils/validateSupabaseBootstrapCredentials.d.ts.map +1 -0
- package/dist/features/platform-infrastructure/utils/validateSupabaseBootstrapCredentials.js +66 -0
- package/dist/features/platform-infrastructure/utils/validateSupabaseBootstrapCredentials.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/types/supabase.d.ts +34 -0
- package/dist/types/supabase.d.ts.map +1 -0
- package/dist/types/supabase.js +2 -0
- package/dist/types/supabase.js.map +1 -0
- package/package.json +67 -4
package/dist/features/platform-infrastructure/application/use-cases/reconcileSupabaseAsync.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcileSupabaseAsync.js","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/reconcileSupabaseAsync.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AAEtG,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,YAAkC,EAClC,OAA8B,EAC9B,cAAsC;IAEtC,MAAM,OAAO,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,OAAO,CAAC;IAChC,MAAM,eAAe,GAAG,8BAA8B,CACpD,OAAO,EACP,OAAO,CAAC,KAAK,CAAC,OAAO,EACrB,cAAc,CACf,CAAC;IACF,IAAI,CAAC,eAAe,CAAC,EAAE;QAAE,OAAO,eAAe,CAAC;IAChD,MAAM,WAAW,GAAG,MAAM,wCAAwC,CAAC,OAAO,CAAC,CAAC;IAC5E,IAAI,CAAC,WAAW,CAAC,EAAE;QAAE,OAAO,WAAW,CAAC;IACxC,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,eAAe,CAAC,KAAK;QAC9B,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,cAAc;QAChD,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;KACpE,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9D,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IAClC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QACrC,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QACtC,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,iBAAiB,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,OAAO,CAAC,EAAE;YAAE,OAAO,OAAO,CAAC;IAClC,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,KAAK,EAAE;YACL,SAAS,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;YAC7D,OAAO,EAAE,aAAa,CACpB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAC/B,OAAO,CAAC,KAAK,CAAC,OAAO,EACrB,WAAW,CAAC,KAAK,CAAC,OAAO,EACzB,OAAO,CAAC,KAAK,CAAC,OAAO,CACtB;SACF;QACD,WAAW,EAAE,EAAE;KAChB,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,SAAS,aAAa,CACpB,aAAmC,EACnC,OAAe,EACf,OAAe,EACf,OAA6F;IAE7F,OAAO;QACL;YACE,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,OAAO;YACd,mBAAmB,EAAE,0BAA0B;SAChD;QACD;YACE,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,OAAO;YACd,mBAAmB,EAAE,+BAA+B;SACrD;QACD,GAAG,OAAO,CAAC,GAAG,CAAc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACvC,KAAK,EAAE,MAAM,CAAC,QAAQ;YACtB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE;SAC/B,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC","sourcesContent":["import type {\n InfraExecutionContext,\n InfraOutput,\n InfraReconcileResult,\n InfraResult,\n} from '@ankhorage/contracts/infra';\n\nimport type { SupabaseControlPlane } from '../../../../types/supabase';\nimport { resolveSupabaseDesiredState } from '../../domain/resolveSupabaseDesiredState';\nimport { resolveSupabaseControlPlaneUrl } from '../../utils/resolveSupabaseControlPlaneUrl';\nimport { resolveSupabaseBootstrapCredentialsAsync } from './resolveSupabaseBootstrapCredentialsAsync';\n\n/*** Reconcile desired Storage buckets and return only safe platform outputs and ownership. */\nexport async function reconcileSupabaseAsync(\n controlPlane: SupabaseControlPlane,\n context: InfraExecutionContext,\n runtimeOutputs: readonly InfraOutput[],\n): Promise<InfraResult<InfraReconcileResult>> {\n const desired = resolveSupabaseDesiredState(context);\n if (!desired.ok) return desired;\n const controlPlaneUrl = resolveSupabaseControlPlaneUrl(\n context,\n desired.value.baseUrl,\n runtimeOutputs,\n );\n if (!controlPlaneUrl.ok) return controlPlaneUrl;\n const credentials = await resolveSupabaseBootstrapCredentialsAsync(context);\n if (!credentials.ok) return credentials;\n const request = {\n baseUrl: controlPlaneUrl.value,\n serviceRoleKey: credentials.value.serviceRoleKey,\n ...(context.signal === undefined ? {} : { signal: context.signal }),\n };\n const existing = await controlPlane.listBucketsAsync(request);\n if (!existing.ok) return existing;\n const existingNames = new Set(existing.value);\n for (const bucket of desired.value.buckets) {\n const name = bucket.externalId ?? '';\n if (existingNames.has(name)) continue;\n const created = await controlPlane.createBucketAsync({ ...request, bucket: name });\n if (!created.ok) return created;\n }\n return {\n ok: true,\n value: {\n resources: [desired.value.platform, ...desired.value.buckets],\n outputs: createOutputs(\n desired.value.platform.identity,\n desired.value.baseUrl,\n credentials.value.anonKey,\n desired.value.buckets,\n ),\n },\n diagnostics: [],\n };\n}\n\n/*** Create public client configuration and non-secret bucket identifiers. */\nfunction createOutputs(\n platformOwner: InfraOutput['owner'],\n baseUrl: string,\n anonKey: string,\n buckets: readonly { readonly identity: InfraOutput['owner']; readonly externalId?: string }[],\n): readonly InfraOutput[] {\n return [\n {\n owner: platformOwner,\n name: 'url',\n visibility: 'public',\n value: baseUrl,\n environmentVariable: 'EXPO_PUBLIC_SUPABASE_URL',\n },\n {\n owner: platformOwner,\n name: 'anonKey',\n visibility: 'public',\n value: anonKey,\n environmentVariable: 'EXPO_PUBLIC_SUPABASE_ANON_KEY',\n },\n ...buckets.map<InfraOutput>((bucket) => ({\n owner: bucket.identity,\n name: 'bucket',\n visibility: 'public',\n value: bucket.externalId ?? '',\n })),\n ];\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InfraExecutionContext, InfraResult } from '@ankhorage/contracts/infra';
|
|
2
|
+
import type { SupabaseBootstrapCredentials } from '../../../../types/supabase';
|
|
3
|
+
/*** Resolve and validate the execution-only Supabase bootstrap credential bundle. */
|
|
4
|
+
export declare function resolveSupabaseBootstrapCredentialsAsync(context: InfraExecutionContext): Promise<InfraResult<SupabaseBootstrapCredentials>>;
|
|
5
|
+
//# sourceMappingURL=resolveSupabaseBootstrapCredentialsAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSupabaseBootstrapCredentialsAsync.d.ts","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/resolveSupabaseBootstrapCredentialsAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAI/E,qFAAqF;AACrF,wBAAsB,wCAAwC,CAC5D,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAGpD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SUPABASE_BOOTSTRAP_CREDENTIAL } from '../../constants/supabase';
|
|
2
|
+
import { validateSupabaseBootstrapCredentials } from '../../utils/validateSupabaseBootstrapCredentials';
|
|
3
|
+
/*** Resolve and validate the execution-only Supabase bootstrap credential bundle. */
|
|
4
|
+
export async function resolveSupabaseBootstrapCredentialsAsync(context) {
|
|
5
|
+
const resolved = await context.credentials.resolveAsync(SUPABASE_BOOTSTRAP_CREDENTIAL);
|
|
6
|
+
return resolved.ok ? validateSupabaseBootstrapCredentials(resolved.value) : resolved;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=resolveSupabaseBootstrapCredentialsAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSupabaseBootstrapCredentialsAsync.js","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/resolveSupabaseBootstrapCredentialsAsync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AAExG,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAC5D,OAA8B;IAE9B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;IACvF,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,oCAAoC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACvF,CAAC","sourcesContent":["import type { InfraExecutionContext, InfraResult } from '@ankhorage/contracts/infra';\n\nimport type { SupabaseBootstrapCredentials } from '../../../../types/supabase';\nimport { SUPABASE_BOOTSTRAP_CREDENTIAL } from '../../constants/supabase';\nimport { validateSupabaseBootstrapCredentials } from '../../utils/validateSupabaseBootstrapCredentials';\n\n/*** Resolve and validate the execution-only Supabase bootstrap credential bundle. */\nexport async function resolveSupabaseBootstrapCredentialsAsync(\n context: InfraExecutionContext,\n): Promise<InfraResult<SupabaseBootstrapCredentials>> {\n const resolved = await context.credentials.resolveAsync(SUPABASE_BOOTSTRAP_CREDENTIAL);\n return resolved.ok ? validateSupabaseBootstrapCredentials(resolved.value) : resolved;\n}\n"]}
|
package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InfraExecutionContext, InfraResult } from '@ankhorage/contracts/infra';
|
|
2
|
+
/*** Validate Supabase selection and credentials without mutating provisionable local bootstrap state. */
|
|
3
|
+
export declare function validateSupabaseAsync(context: InfraExecutionContext): Promise<InfraResult<null>>;
|
|
4
|
+
//# sourceMappingURL=validateSupabaseAsync.d.ts.map
|
package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSupabaseAsync.d.ts","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAQrF,yGAAyG;AACzG,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAa5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SUPABASE_BOOTSTRAP_CREDENTIAL } from '../../constants/supabase';
|
|
2
|
+
import { resolveSupabaseDesiredState } from '../../domain/resolveSupabaseDesiredState';
|
|
3
|
+
import { validateSupabaseBootstrapCredentials } from '../../utils/validateSupabaseBootstrapCredentials';
|
|
4
|
+
import { resolveSupabaseBootstrapCredentialsAsync } from './resolveSupabaseBootstrapCredentialsAsync';
|
|
5
|
+
import { validateSupabasePersistenceCredentialsAsync } from './validateSupabasePersistenceCredentialsAsync';
|
|
6
|
+
/*** Validate Supabase selection and credentials without mutating provisionable local bootstrap state. */
|
|
7
|
+
export async function validateSupabaseAsync(context) {
|
|
8
|
+
const desired = resolveSupabaseDesiredState(context);
|
|
9
|
+
if (!desired.ok)
|
|
10
|
+
return desired;
|
|
11
|
+
const found = await context.credentials.findAsync(SUPABASE_BOOTSTRAP_CREDENTIAL);
|
|
12
|
+
if (!found.ok)
|
|
13
|
+
return found;
|
|
14
|
+
if (found.value !== null) {
|
|
15
|
+
const bootstrap = validateSupabaseBootstrapCredentials(found.value);
|
|
16
|
+
if (!bootstrap.ok)
|
|
17
|
+
return bootstrap;
|
|
18
|
+
}
|
|
19
|
+
else if (context.environment !== 'local') {
|
|
20
|
+
const required = await resolveSupabaseBootstrapCredentialsAsync(context);
|
|
21
|
+
if (!required.ok)
|
|
22
|
+
return required;
|
|
23
|
+
}
|
|
24
|
+
return validateSupabasePersistenceCredentialsAsync(context);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=validateSupabaseAsync.js.map
|
package/dist/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSupabaseAsync.js","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/validateSupabaseAsync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AACxG,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EAAE,2CAA2C,EAAE,MAAM,+CAA+C,CAAC;AAE5G,yGAAyG;AACzG,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAA8B;IAE9B,MAAM,OAAO,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,OAAO,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;IACjF,IAAI,CAAC,KAAK,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IAC5B,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,oCAAoC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpE,IAAI,CAAC,SAAS,CAAC,EAAE;YAAE,OAAO,SAAS,CAAC;IACtC,CAAC;SAAM,IAAI,OAAO,CAAC,WAAW,KAAK,OAAO,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,wCAAwC,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,OAAO,QAAQ,CAAC;IACpC,CAAC;IACD,OAAO,2CAA2C,CAAC,OAAO,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import type { InfraExecutionContext, InfraResult } from '@ankhorage/contracts/infra';\n\nimport { SUPABASE_BOOTSTRAP_CREDENTIAL } from '../../constants/supabase';\nimport { resolveSupabaseDesiredState } from '../../domain/resolveSupabaseDesiredState';\nimport { validateSupabaseBootstrapCredentials } from '../../utils/validateSupabaseBootstrapCredentials';\nimport { resolveSupabaseBootstrapCredentialsAsync } from './resolveSupabaseBootstrapCredentialsAsync';\nimport { validateSupabasePersistenceCredentialsAsync } from './validateSupabasePersistenceCredentialsAsync';\n\n/*** Validate Supabase selection and credentials without mutating provisionable local bootstrap state. */\nexport async function validateSupabaseAsync(\n context: InfraExecutionContext,\n): Promise<InfraResult<null>> {\n const desired = resolveSupabaseDesiredState(context);\n if (!desired.ok) return desired;\n const found = await context.credentials.findAsync(SUPABASE_BOOTSTRAP_CREDENTIAL);\n if (!found.ok) return found;\n if (found.value !== null) {\n const bootstrap = validateSupabaseBootstrapCredentials(found.value);\n if (!bootstrap.ok) return bootstrap;\n } else if (context.environment !== 'local') {\n const required = await resolveSupabaseBootstrapCredentialsAsync(context);\n if (!required.ok) return required;\n }\n return validateSupabasePersistenceCredentialsAsync(context);\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InfraExecutionContext, InfraResult } from '@ankhorage/contracts/infra';
|
|
2
|
+
/*** Validate every selected S3 persistence credential without serializing its resolved values. */
|
|
3
|
+
export declare function validateSupabasePersistenceCredentialsAsync(context: InfraExecutionContext): Promise<InfraResult<null>>;
|
|
4
|
+
//# sourceMappingURL=validateSupabasePersistenceCredentialsAsync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSupabasePersistenceCredentialsAsync.d.ts","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/validateSupabasePersistenceCredentialsAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EACrB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,kGAAkG;AAClG,wBAAsB,2CAA2C,CAC/D,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAQ5B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*** Validate every selected S3 persistence credential without serializing its resolved values. */
|
|
2
|
+
export async function validateSupabasePersistenceCredentialsAsync(context) {
|
|
3
|
+
const references = uniqueReferences(resolveTargets(context).map(({ credentials }) => credentials));
|
|
4
|
+
const results = await Promise.all(references.map(async (reference) => validateCredentialAsync(context, reference)));
|
|
5
|
+
return results.find((result) => !result.ok) ?? { ok: true, value: null, diagnostics: [] };
|
|
6
|
+
}
|
|
7
|
+
/*** Collect database-backup and Storage-backend S3 targets from the selected Supabase platform. */
|
|
8
|
+
function resolveTargets(context) {
|
|
9
|
+
const backup = context.desired.database?.provider === 'supabase' ? context.desired.database.backup : undefined;
|
|
10
|
+
const backend = context.desired.objectStorage?.provider === 'supabase'
|
|
11
|
+
? context.desired.objectStorage.backend
|
|
12
|
+
: undefined;
|
|
13
|
+
return [backup?.target, backend].filter((target) => target !== undefined);
|
|
14
|
+
}
|
|
15
|
+
/*** Deduplicate control-plane references without mutating shared credential state. */
|
|
16
|
+
function uniqueReferences(references) {
|
|
17
|
+
return references.filter((reference, index) => references.findIndex((candidate) => candidate.name === reference.name) === index);
|
|
18
|
+
}
|
|
19
|
+
/*** Resolve and validate one S3 access-key credential bundle. */
|
|
20
|
+
async function validateCredentialAsync(context, reference) {
|
|
21
|
+
const resolved = await context.credentials.resolveAsync(reference);
|
|
22
|
+
if (!resolved.ok)
|
|
23
|
+
return resolved;
|
|
24
|
+
const { accessKeyId, secretAccessKey } = resolved.value;
|
|
25
|
+
return isNonEmptyText(accessKeyId) && isNonEmptyText(secretAccessKey)
|
|
26
|
+
? { ok: true, value: null, diagnostics: [] }
|
|
27
|
+
: {
|
|
28
|
+
ok: false,
|
|
29
|
+
diagnostics: [
|
|
30
|
+
{
|
|
31
|
+
severity: 'error',
|
|
32
|
+
code: 'supabase-s3-credentials-invalid',
|
|
33
|
+
message: `Supabase S3 persistence credential "${reference.name}" must provide accessKeyId and secretAccessKey.`,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/*** Accept one non-empty credential field without exposing its value in diagnostics. */
|
|
39
|
+
function isNonEmptyText(value) {
|
|
40
|
+
return typeof value === 'string' && value.length > 0;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=validateSupabasePersistenceCredentialsAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSupabasePersistenceCredentialsAsync.js","sourceRoot":"","sources":["../../../../../src/features/platform-infrastructure/application/use-cases/validateSupabasePersistenceCredentialsAsync.ts"],"names":[],"mappings":"AAOA,kGAAkG;AAClG,MAAM,CAAC,KAAK,UAAU,2CAA2C,CAC/D,OAA8B;IAE9B,MAAM,UAAU,GAAG,gBAAgB,CACjC,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,CAC9D,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CACjF,CAAC;IACF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AAC5F,CAAC;AAED,mGAAmG;AACnG,SAAS,cAAc,CAAC,OAA8B;IACpD,MAAM,MAAM,GACV,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAClG,MAAM,OAAO,GACX,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,KAAK,UAAU;QACpD,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO;QACvC,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,CACrC,CAAC,MAAM,EAAsC,EAAE,CAAC,MAAM,KAAK,SAAS,CACrE,CAAC;AACJ,CAAC;AAED,sFAAsF;AACtF,SAAS,gBAAgB,CACvB,UAAqD;IAErD,OAAO,UAAU,CAAC,MAAM,CACtB,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CACnB,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,CACnF,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,KAAK,UAAU,uBAAuB,CACpC,OAA8B,EAC9B,SAAyC;IAEzC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACnE,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IAClC,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC;IACxD,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,cAAc,CAAC,eAAe,CAAC;QACnE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE;QAC5C,CAAC,CAAC;YACE,EAAE,EAAE,KAAK;YACT,WAAW,EAAE;gBACX;oBACE,QAAQ,EAAE,OAAO;oBACjB,IAAI,EAAE,iCAAiC;oBACvC,OAAO,EAAE,uCAAuC,SAAS,CAAC,IAAI,iDAAiD;iBAChH;aACF;SACF,CAAC;AACR,CAAC;AAED,wFAAwF;AACxF,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import type {\n InfraControlPlaneCredentialRef,\n InfraExecutionContext,\n InfraResult,\n InfraS3PersistenceTarget,\n} from '@ankhorage/contracts/infra';\n\n/*** Validate every selected S3 persistence credential without serializing its resolved values. */\nexport async function validateSupabasePersistenceCredentialsAsync(\n context: InfraExecutionContext,\n): Promise<InfraResult<null>> {\n const references = uniqueReferences(\n resolveTargets(context).map(({ credentials }) => credentials),\n );\n const results = await Promise.all(\n references.map(async (reference) => validateCredentialAsync(context, reference)),\n );\n return results.find((result) => !result.ok) ?? { ok: true, value: null, diagnostics: [] };\n}\n\n/*** Collect database-backup and Storage-backend S3 targets from the selected Supabase platform. */\nfunction resolveTargets(context: InfraExecutionContext): readonly InfraS3PersistenceTarget[] {\n const backup =\n context.desired.database?.provider === 'supabase' ? context.desired.database.backup : undefined;\n const backend =\n context.desired.objectStorage?.provider === 'supabase'\n ? context.desired.objectStorage.backend\n : undefined;\n return [backup?.target, backend].filter(\n (target): target is InfraS3PersistenceTarget => target !== undefined,\n );\n}\n\n/*** Deduplicate control-plane references without mutating shared credential state. */\nfunction uniqueReferences(\n references: readonly InfraControlPlaneCredentialRef[],\n): readonly InfraControlPlaneCredentialRef[] {\n return references.filter(\n (reference, index) =>\n references.findIndex((candidate) => candidate.name === reference.name) === index,\n );\n}\n\n/*** Resolve and validate one S3 access-key credential bundle. */\nasync function validateCredentialAsync(\n context: InfraExecutionContext,\n reference: InfraControlPlaneCredentialRef,\n): Promise<InfraResult<null>> {\n const resolved = await context.credentials.resolveAsync(reference);\n if (!resolved.ok) return resolved;\n const { accessKeyId, secretAccessKey } = resolved.value;\n return isNonEmptyText(accessKeyId) && isNonEmptyText(secretAccessKey)\n ? { ok: true, value: null, diagnostics: [] }\n : {\n ok: false,\n diagnostics: [\n {\n severity: 'error',\n code: 'supabase-s3-credentials-invalid',\n message: `Supabase S3 persistence credential \"${reference.name}\" must provide accessKeyId and secretAccessKey.`,\n },\n ],\n };\n}\n\n/*** Accept one non-empty credential field without exposing its value in diagnostics. */\nfunction isNonEmptyText(value: unknown): value is string {\n return typeof value === 'string' && value.length > 0;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InfraServiceAdapter } from '@ankhorage/contracts/infra';
|
|
2
|
+
import type { SupabaseAdapterOptions } from '../../../types/supabase';
|
|
3
|
+
/***
|
|
4
|
+
* Create the canonical runtime-neutral Supabase platform adapter.
|
|
5
|
+
*
|
|
6
|
+
* The provider contributes portable workloads and reconciles Supabase-owned API resources after
|
|
7
|
+
* the selected runtime is ready. Resolved bootstrap secrets never cross the execution boundary.
|
|
8
|
+
*
|
|
9
|
+
* @readme
|
|
10
|
+
*/
|
|
11
|
+
export declare function createInfraAdapter(options?: SupabaseAdapterOptions): InfraServiceAdapter;
|
|
12
|
+
//# sourceMappingURL=createInfraAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInfraAdapter.d.ts","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/composition/createInfraAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAWtE;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,sBAA2B,GAAG,mBAAmB,CAoB5F"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { infraAdapterDescriptor } from '../../../constants/infra';
|
|
2
|
+
import { createFetchSupabaseControlPlane } from '../adapters/outbound/createFetchSupabaseControlPlane';
|
|
3
|
+
import { destroySupabaseAsync } from '../application/use-cases/destroySupabaseAsync';
|
|
4
|
+
import { getSupabaseStatusAsync } from '../application/use-cases/getSupabaseStatusAsync';
|
|
5
|
+
import { planSupabase } from '../application/use-cases/planSupabase';
|
|
6
|
+
import { prepareSupabaseBootstrapCredentialsAsync } from '../application/use-cases/prepareSupabaseBootstrapCredentialsAsync';
|
|
7
|
+
import { reconcileSupabaseAsync } from '../application/use-cases/reconcileSupabaseAsync';
|
|
8
|
+
import { validateSupabaseAsync } from '../application/use-cases/validateSupabaseAsync';
|
|
9
|
+
import { createSupabaseWorkloads } from '../domain/createSupabaseWorkloads';
|
|
10
|
+
import { resolveSupabaseDesiredState } from '../domain/resolveSupabaseDesiredState';
|
|
11
|
+
/***
|
|
12
|
+
* Create the canonical runtime-neutral Supabase platform adapter.
|
|
13
|
+
*
|
|
14
|
+
* The provider contributes portable workloads and reconciles Supabase-owned API resources after
|
|
15
|
+
* the selected runtime is ready. Resolved bootstrap secrets never cross the execution boundary.
|
|
16
|
+
*
|
|
17
|
+
* @readme
|
|
18
|
+
*/
|
|
19
|
+
export function createInfraAdapter(options = {}) {
|
|
20
|
+
const controlPlane = options.controlPlane ?? createFetchSupabaseControlPlane();
|
|
21
|
+
return {
|
|
22
|
+
descriptor: infraAdapterDescriptor,
|
|
23
|
+
validateAsync: (context) => validateSupabaseAsync(context),
|
|
24
|
+
planAsync: (context) => Promise.resolve(planSupabase(context)),
|
|
25
|
+
prepareAsync: (context) => prepareSupabaseBootstrapCredentialsAsync(context),
|
|
26
|
+
desiredWorkloadsAsync: (context) => {
|
|
27
|
+
const desired = resolveSupabaseDesiredState(context);
|
|
28
|
+
return Promise.resolve(desired.ok
|
|
29
|
+
? { ok: true, value: createSupabaseWorkloads(context), diagnostics: [] }
|
|
30
|
+
: desired);
|
|
31
|
+
},
|
|
32
|
+
reconcileAsync: (context, runtimeOutputs) => reconcileSupabaseAsync(controlPlane, context, runtimeOutputs),
|
|
33
|
+
statusAsync: (context) => getSupabaseStatusAsync(controlPlane, context),
|
|
34
|
+
destroyAsync: (context, request) => destroySupabaseAsync(controlPlane, context, request),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=createInfraAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInfraAdapter.js","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/composition/createInfraAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sDAAsD,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,wCAAwC,EAAE,MAAM,mEAAmE,CAAC;AAC7H,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkC,EAAE;IACrE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,+BAA+B,EAAE,CAAC;IAC/E,OAAO;QACL,UAAU,EAAE,sBAAsB;QAClC,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC;QAC1D,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,wCAAwC,CAAC,OAAO,CAAC;QAC5E,qBAAqB,EAAE,CAAC,OAAO,EAAE,EAAE;YACjC,MAAM,OAAO,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;YACrD,OAAO,OAAO,CAAC,OAAO,CACpB,OAAO,CAAC,EAAE;gBACR,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;gBACxE,CAAC,CAAC,OAAO,CACZ,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,CAC1C,sBAAsB,CAAC,YAAY,EAAE,OAAO,EAAE,cAAc,CAAC;QAC/D,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,YAAY,EAAE,OAAO,CAAC;QACvE,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,oBAAoB,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC;KACzF,CAAC;AACJ,CAAC","sourcesContent":["import type { InfraServiceAdapter } from '@ankhorage/contracts/infra';\n\nimport { infraAdapterDescriptor } from '../../../constants/infra';\nimport type { SupabaseAdapterOptions } from '../../../types/supabase';\nimport { createFetchSupabaseControlPlane } from '../adapters/outbound/createFetchSupabaseControlPlane';\nimport { destroySupabaseAsync } from '../application/use-cases/destroySupabaseAsync';\nimport { getSupabaseStatusAsync } from '../application/use-cases/getSupabaseStatusAsync';\nimport { planSupabase } from '../application/use-cases/planSupabase';\nimport { prepareSupabaseBootstrapCredentialsAsync } from '../application/use-cases/prepareSupabaseBootstrapCredentialsAsync';\nimport { reconcileSupabaseAsync } from '../application/use-cases/reconcileSupabaseAsync';\nimport { validateSupabaseAsync } from '../application/use-cases/validateSupabaseAsync';\nimport { createSupabaseWorkloads } from '../domain/createSupabaseWorkloads';\nimport { resolveSupabaseDesiredState } from '../domain/resolveSupabaseDesiredState';\n\n/***\n * Create the canonical runtime-neutral Supabase platform adapter.\n *\n * The provider contributes portable workloads and reconciles Supabase-owned API resources after\n * the selected runtime is ready. Resolved bootstrap secrets never cross the execution boundary.\n *\n * @readme\n */\nexport function createInfraAdapter(options: SupabaseAdapterOptions = {}): InfraServiceAdapter {\n const controlPlane = options.controlPlane ?? createFetchSupabaseControlPlane();\n return {\n descriptor: infraAdapterDescriptor,\n validateAsync: (context) => validateSupabaseAsync(context),\n planAsync: (context) => Promise.resolve(planSupabase(context)),\n prepareAsync: (context) => prepareSupabaseBootstrapCredentialsAsync(context),\n desiredWorkloadsAsync: (context) => {\n const desired = resolveSupabaseDesiredState(context);\n return Promise.resolve(\n desired.ok\n ? { ok: true, value: createSupabaseWorkloads(context), diagnostics: [] }\n : desired,\n );\n },\n reconcileAsync: (context, runtimeOutputs) =>\n reconcileSupabaseAsync(controlPlane, context, runtimeOutputs),\n statusAsync: (context) => getSupabaseStatusAsync(controlPlane, context),\n destroyAsync: (context, request) => destroySupabaseAsync(controlPlane, context, request),\n };\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const SUPABASE_DATABASE_WEBHOOKS_SQL = "BEGIN;\n CREATE EXTENSION IF NOT EXISTS pg_net SCHEMA extensions;\n CREATE SCHEMA supabase_functions AUTHORIZATION supabase_admin;\n GRANT USAGE ON SCHEMA supabase_functions TO postgres, anon, authenticated, service_role;\n ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON TABLES TO postgres, anon, authenticated, service_role;\n ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON FUNCTIONS TO postgres, anon, authenticated, service_role;\n ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON SEQUENCES TO postgres, anon, authenticated, service_role;\n\n CREATE TABLE supabase_functions.migrations (\n version text PRIMARY KEY,\n inserted_at timestamptz NOT NULL DEFAULT NOW()\n );\n\n INSERT INTO supabase_functions.migrations (version) VALUES ('initial');\n\n CREATE TABLE supabase_functions.hooks (\n id bigserial PRIMARY KEY,\n hook_table_id integer NOT NULL,\n hook_name text NOT NULL,\n created_at timestamptz NOT NULL DEFAULT NOW(),\n request_id bigint\n );\n\n CREATE INDEX supabase_functions_hooks_request_id_idx ON supabase_functions.hooks USING btree (request_id);\n CREATE INDEX supabase_functions_hooks_h_table_id_h_name_idx ON supabase_functions.hooks USING btree (hook_table_id, hook_name);\n COMMENT ON TABLE supabase_functions.hooks IS 'Supabase Functions Hooks: Audit trail for triggered hooks.';\n\n CREATE FUNCTION supabase_functions.http_request()\n RETURNS trigger\n LANGUAGE plpgsql\n AS $function$\n DECLARE\n request_id bigint;\n payload jsonb;\n url text := TG_ARGV[0]::text;\n method text := TG_ARGV[1]::text;\n headers jsonb DEFAULT '{}'::jsonb;\n params jsonb DEFAULT '{}'::jsonb;\n timeout_ms integer DEFAULT 1000;\n BEGIN\n IF url IS NULL OR url = 'null' THEN\n RAISE EXCEPTION 'url argument is missing';\n END IF;\n\n IF method IS NULL OR method = 'null' THEN\n RAISE EXCEPTION 'method argument is missing';\n END IF;\n\n IF TG_ARGV[2] IS NULL OR TG_ARGV[2] = 'null' THEN\n headers = '{\"Content-Type\": \"application/json\"}'::jsonb;\n ELSE\n headers = TG_ARGV[2]::jsonb;\n END IF;\n\n IF TG_ARGV[3] IS NULL OR TG_ARGV[3] = 'null' THEN\n params = '{}'::jsonb;\n ELSE\n params = TG_ARGV[3]::jsonb;\n END IF;\n\n IF TG_ARGV[4] IS NULL OR TG_ARGV[4] = 'null' THEN\n timeout_ms = 1000;\n ELSE\n timeout_ms = TG_ARGV[4]::integer;\n END IF;\n\n CASE\n WHEN method = 'GET' THEN\n SELECT http_get INTO request_id FROM net.http_get(\n url,\n params,\n headers,\n timeout_ms\n );\n WHEN method = 'POST' THEN\n payload = jsonb_build_object(\n 'old_record', OLD,\n 'record', NEW,\n 'type', TG_OP,\n 'table', TG_TABLE_NAME,\n 'schema', TG_TABLE_SCHEMA\n );\n\n SELECT http_post INTO request_id FROM net.http_post(\n url,\n payload,\n params,\n headers,\n timeout_ms\n );\n ELSE\n RAISE EXCEPTION 'method argument % is invalid', method;\n END CASE;\n\n INSERT INTO supabase_functions.hooks\n (hook_table_id, hook_name, request_id)\n VALUES\n (TG_RELID, TG_NAME, request_id);\n\n RETURN NEW;\n END\n $function$;\n\n DO\n $$\n BEGIN\n IF NOT EXISTS (\n SELECT 1\n FROM pg_roles\n WHERE rolname = 'supabase_functions_admin'\n )\n THEN\n CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION;\n END IF;\n END\n $$;\n\n GRANT ALL PRIVILEGES ON SCHEMA supabase_functions TO supabase_functions_admin;\n GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA supabase_functions TO supabase_functions_admin;\n GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA supabase_functions TO supabase_functions_admin;\n ALTER USER supabase_functions_admin SET search_path = \"supabase_functions\";\n ALTER table \"supabase_functions\".migrations OWNER TO supabase_functions_admin;\n ALTER table \"supabase_functions\".hooks OWNER TO supabase_functions_admin;\n ALTER function \"supabase_functions\".http_request() OWNER TO supabase_functions_admin;\n GRANT supabase_functions_admin TO postgres;\n\n DO\n $$\n BEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_roles\n WHERE rolname = 'supabase_pg_net_admin'\n )\n THEN\n REASSIGN OWNED BY supabase_pg_net_admin TO supabase_admin;\n DROP OWNED BY supabase_pg_net_admin;\n DROP ROLE supabase_pg_net_admin;\n END IF;\n END\n $$;\n\n DO\n $$\n BEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_extension\n WHERE extname = 'pg_net'\n )\n THEN\n GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n END IF;\n END\n $$;\n\n CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access()\n RETURNS event_trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_event_trigger_ddl_commands() AS ev\n JOIN pg_extension AS ext\n ON ev.objid = ext.oid\n WHERE ext.extname = 'pg_net'\n )\n THEN\n GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n END IF;\n END;\n $$;\n\n COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net';\n\n DO\n $$\n BEGIN\n IF NOT EXISTS (\n SELECT 1\n FROM pg_event_trigger\n WHERE evtname = 'issue_pg_net_access'\n ) THEN\n CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end WHEN TAG IN ('CREATE EXTENSION')\n EXECUTE PROCEDURE extensions.grant_pg_net_access();\n END IF;\n END\n $$;\n\n INSERT INTO supabase_functions.migrations (version) VALUES ('20210809183423_update_grants');\n ALTER function supabase_functions.http_request() SECURITY DEFINER;\n ALTER function supabase_functions.http_request() SET search_path = supabase_functions;\n REVOKE ALL ON FUNCTION supabase_functions.http_request() FROM PUBLIC;\n GRANT EXECUTE ON FUNCTION supabase_functions.http_request() TO postgres, anon, authenticated, service_role;\nCOMMIT;\n";
|
|
2
|
+
export declare const SUPABASE_DATABASE_ROLES_SQL = "\\set pgpass `echo \"$POSTGRES_PASSWORD\"`\n\nALTER USER authenticator WITH PASSWORD :'pgpass';\nALTER USER pgbouncer WITH PASSWORD :'pgpass';\nALTER USER supabase_auth_admin WITH PASSWORD :'pgpass';\nALTER USER supabase_functions_admin WITH PASSWORD :'pgpass';\nALTER USER supabase_storage_admin WITH PASSWORD :'pgpass';\n";
|
|
3
|
+
export declare const SUPABASE_DATABASE_JWT_SQL = "\\set jwt_secret `echo \"$JWT_SECRET\"`\n\\set jwt_exp `echo \"$JWT_EXP\"`\n\nALTER DATABASE postgres SET \"app.settings.jwt_secret\" TO :'jwt_secret';\nALTER DATABASE postgres SET \"app.settings.jwt_exp\" TO :'jwt_exp';\n";
|
|
4
|
+
export declare const SUPABASE_DATABASE_REALTIME_SQL = "\\set pguser `echo \"$POSTGRES_USER\"`\n\ncreate schema if not exists _realtime;\nalter schema _realtime owner to :pguser;\n";
|
|
5
|
+
//# sourceMappingURL=databaseBootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databaseBootstrap.d.ts","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/constants/databaseBootstrap.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,s9QAoN1C,CAAC;AAEF,eAAO,MAAM,2BAA2B,wUAOvC,CAAC;AAEF,eAAO,MAAM,yBAAyB,mOAKrC,CAAC;AAEF,eAAO,MAAM,8BAA8B,iIAI1C,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
export const SUPABASE_DATABASE_WEBHOOKS_SQL = `BEGIN;
|
|
2
|
+
CREATE EXTENSION IF NOT EXISTS pg_net SCHEMA extensions;
|
|
3
|
+
CREATE SCHEMA supabase_functions AUTHORIZATION supabase_admin;
|
|
4
|
+
GRANT USAGE ON SCHEMA supabase_functions TO postgres, anon, authenticated, service_role;
|
|
5
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON TABLES TO postgres, anon, authenticated, service_role;
|
|
6
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON FUNCTIONS TO postgres, anon, authenticated, service_role;
|
|
7
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON SEQUENCES TO postgres, anon, authenticated, service_role;
|
|
8
|
+
|
|
9
|
+
CREATE TABLE supabase_functions.migrations (
|
|
10
|
+
version text PRIMARY KEY,
|
|
11
|
+
inserted_at timestamptz NOT NULL DEFAULT NOW()
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
INSERT INTO supabase_functions.migrations (version) VALUES ('initial');
|
|
15
|
+
|
|
16
|
+
CREATE TABLE supabase_functions.hooks (
|
|
17
|
+
id bigserial PRIMARY KEY,
|
|
18
|
+
hook_table_id integer NOT NULL,
|
|
19
|
+
hook_name text NOT NULL,
|
|
20
|
+
created_at timestamptz NOT NULL DEFAULT NOW(),
|
|
21
|
+
request_id bigint
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
CREATE INDEX supabase_functions_hooks_request_id_idx ON supabase_functions.hooks USING btree (request_id);
|
|
25
|
+
CREATE INDEX supabase_functions_hooks_h_table_id_h_name_idx ON supabase_functions.hooks USING btree (hook_table_id, hook_name);
|
|
26
|
+
COMMENT ON TABLE supabase_functions.hooks IS 'Supabase Functions Hooks: Audit trail for triggered hooks.';
|
|
27
|
+
|
|
28
|
+
CREATE FUNCTION supabase_functions.http_request()
|
|
29
|
+
RETURNS trigger
|
|
30
|
+
LANGUAGE plpgsql
|
|
31
|
+
AS $function$
|
|
32
|
+
DECLARE
|
|
33
|
+
request_id bigint;
|
|
34
|
+
payload jsonb;
|
|
35
|
+
url text := TG_ARGV[0]::text;
|
|
36
|
+
method text := TG_ARGV[1]::text;
|
|
37
|
+
headers jsonb DEFAULT '{}'::jsonb;
|
|
38
|
+
params jsonb DEFAULT '{}'::jsonb;
|
|
39
|
+
timeout_ms integer DEFAULT 1000;
|
|
40
|
+
BEGIN
|
|
41
|
+
IF url IS NULL OR url = 'null' THEN
|
|
42
|
+
RAISE EXCEPTION 'url argument is missing';
|
|
43
|
+
END IF;
|
|
44
|
+
|
|
45
|
+
IF method IS NULL OR method = 'null' THEN
|
|
46
|
+
RAISE EXCEPTION 'method argument is missing';
|
|
47
|
+
END IF;
|
|
48
|
+
|
|
49
|
+
IF TG_ARGV[2] IS NULL OR TG_ARGV[2] = 'null' THEN
|
|
50
|
+
headers = '{"Content-Type": "application/json"}'::jsonb;
|
|
51
|
+
ELSE
|
|
52
|
+
headers = TG_ARGV[2]::jsonb;
|
|
53
|
+
END IF;
|
|
54
|
+
|
|
55
|
+
IF TG_ARGV[3] IS NULL OR TG_ARGV[3] = 'null' THEN
|
|
56
|
+
params = '{}'::jsonb;
|
|
57
|
+
ELSE
|
|
58
|
+
params = TG_ARGV[3]::jsonb;
|
|
59
|
+
END IF;
|
|
60
|
+
|
|
61
|
+
IF TG_ARGV[4] IS NULL OR TG_ARGV[4] = 'null' THEN
|
|
62
|
+
timeout_ms = 1000;
|
|
63
|
+
ELSE
|
|
64
|
+
timeout_ms = TG_ARGV[4]::integer;
|
|
65
|
+
END IF;
|
|
66
|
+
|
|
67
|
+
CASE
|
|
68
|
+
WHEN method = 'GET' THEN
|
|
69
|
+
SELECT http_get INTO request_id FROM net.http_get(
|
|
70
|
+
url,
|
|
71
|
+
params,
|
|
72
|
+
headers,
|
|
73
|
+
timeout_ms
|
|
74
|
+
);
|
|
75
|
+
WHEN method = 'POST' THEN
|
|
76
|
+
payload = jsonb_build_object(
|
|
77
|
+
'old_record', OLD,
|
|
78
|
+
'record', NEW,
|
|
79
|
+
'type', TG_OP,
|
|
80
|
+
'table', TG_TABLE_NAME,
|
|
81
|
+
'schema', TG_TABLE_SCHEMA
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
SELECT http_post INTO request_id FROM net.http_post(
|
|
85
|
+
url,
|
|
86
|
+
payload,
|
|
87
|
+
params,
|
|
88
|
+
headers,
|
|
89
|
+
timeout_ms
|
|
90
|
+
);
|
|
91
|
+
ELSE
|
|
92
|
+
RAISE EXCEPTION 'method argument % is invalid', method;
|
|
93
|
+
END CASE;
|
|
94
|
+
|
|
95
|
+
INSERT INTO supabase_functions.hooks
|
|
96
|
+
(hook_table_id, hook_name, request_id)
|
|
97
|
+
VALUES
|
|
98
|
+
(TG_RELID, TG_NAME, request_id);
|
|
99
|
+
|
|
100
|
+
RETURN NEW;
|
|
101
|
+
END
|
|
102
|
+
$function$;
|
|
103
|
+
|
|
104
|
+
DO
|
|
105
|
+
$$
|
|
106
|
+
BEGIN
|
|
107
|
+
IF NOT EXISTS (
|
|
108
|
+
SELECT 1
|
|
109
|
+
FROM pg_roles
|
|
110
|
+
WHERE rolname = 'supabase_functions_admin'
|
|
111
|
+
)
|
|
112
|
+
THEN
|
|
113
|
+
CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION;
|
|
114
|
+
END IF;
|
|
115
|
+
END
|
|
116
|
+
$$;
|
|
117
|
+
|
|
118
|
+
GRANT ALL PRIVILEGES ON SCHEMA supabase_functions TO supabase_functions_admin;
|
|
119
|
+
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA supabase_functions TO supabase_functions_admin;
|
|
120
|
+
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA supabase_functions TO supabase_functions_admin;
|
|
121
|
+
ALTER USER supabase_functions_admin SET search_path = "supabase_functions";
|
|
122
|
+
ALTER table "supabase_functions".migrations OWNER TO supabase_functions_admin;
|
|
123
|
+
ALTER table "supabase_functions".hooks OWNER TO supabase_functions_admin;
|
|
124
|
+
ALTER function "supabase_functions".http_request() OWNER TO supabase_functions_admin;
|
|
125
|
+
GRANT supabase_functions_admin TO postgres;
|
|
126
|
+
|
|
127
|
+
DO
|
|
128
|
+
$$
|
|
129
|
+
BEGIN
|
|
130
|
+
IF EXISTS (
|
|
131
|
+
SELECT 1
|
|
132
|
+
FROM pg_roles
|
|
133
|
+
WHERE rolname = 'supabase_pg_net_admin'
|
|
134
|
+
)
|
|
135
|
+
THEN
|
|
136
|
+
REASSIGN OWNED BY supabase_pg_net_admin TO supabase_admin;
|
|
137
|
+
DROP OWNED BY supabase_pg_net_admin;
|
|
138
|
+
DROP ROLE supabase_pg_net_admin;
|
|
139
|
+
END IF;
|
|
140
|
+
END
|
|
141
|
+
$$;
|
|
142
|
+
|
|
143
|
+
DO
|
|
144
|
+
$$
|
|
145
|
+
BEGIN
|
|
146
|
+
IF EXISTS (
|
|
147
|
+
SELECT 1
|
|
148
|
+
FROM pg_extension
|
|
149
|
+
WHERE extname = 'pg_net'
|
|
150
|
+
)
|
|
151
|
+
THEN
|
|
152
|
+
GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;
|
|
153
|
+
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
|
|
154
|
+
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
|
|
155
|
+
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
|
|
156
|
+
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
|
|
157
|
+
REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
|
|
158
|
+
REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
|
|
159
|
+
GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
|
|
160
|
+
GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
|
|
161
|
+
END IF;
|
|
162
|
+
END
|
|
163
|
+
$$;
|
|
164
|
+
|
|
165
|
+
CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access()
|
|
166
|
+
RETURNS event_trigger
|
|
167
|
+
LANGUAGE plpgsql
|
|
168
|
+
AS $$
|
|
169
|
+
BEGIN
|
|
170
|
+
IF EXISTS (
|
|
171
|
+
SELECT 1
|
|
172
|
+
FROM pg_event_trigger_ddl_commands() AS ev
|
|
173
|
+
JOIN pg_extension AS ext
|
|
174
|
+
ON ev.objid = ext.oid
|
|
175
|
+
WHERE ext.extname = 'pg_net'
|
|
176
|
+
)
|
|
177
|
+
THEN
|
|
178
|
+
GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;
|
|
179
|
+
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
|
|
180
|
+
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
|
|
181
|
+
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
|
|
182
|
+
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
|
|
183
|
+
REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
|
|
184
|
+
REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
|
|
185
|
+
GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
|
|
186
|
+
GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
|
|
187
|
+
END IF;
|
|
188
|
+
END;
|
|
189
|
+
$$;
|
|
190
|
+
|
|
191
|
+
COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net';
|
|
192
|
+
|
|
193
|
+
DO
|
|
194
|
+
$$
|
|
195
|
+
BEGIN
|
|
196
|
+
IF NOT EXISTS (
|
|
197
|
+
SELECT 1
|
|
198
|
+
FROM pg_event_trigger
|
|
199
|
+
WHERE evtname = 'issue_pg_net_access'
|
|
200
|
+
) THEN
|
|
201
|
+
CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end WHEN TAG IN ('CREATE EXTENSION')
|
|
202
|
+
EXECUTE PROCEDURE extensions.grant_pg_net_access();
|
|
203
|
+
END IF;
|
|
204
|
+
END
|
|
205
|
+
$$;
|
|
206
|
+
|
|
207
|
+
INSERT INTO supabase_functions.migrations (version) VALUES ('20210809183423_update_grants');
|
|
208
|
+
ALTER function supabase_functions.http_request() SECURITY DEFINER;
|
|
209
|
+
ALTER function supabase_functions.http_request() SET search_path = supabase_functions;
|
|
210
|
+
REVOKE ALL ON FUNCTION supabase_functions.http_request() FROM PUBLIC;
|
|
211
|
+
GRANT EXECUTE ON FUNCTION supabase_functions.http_request() TO postgres, anon, authenticated, service_role;
|
|
212
|
+
COMMIT;
|
|
213
|
+
`;
|
|
214
|
+
export const SUPABASE_DATABASE_ROLES_SQL = `\\set pgpass \`echo "$POSTGRES_PASSWORD"\`
|
|
215
|
+
|
|
216
|
+
ALTER USER authenticator WITH PASSWORD :'pgpass';
|
|
217
|
+
ALTER USER pgbouncer WITH PASSWORD :'pgpass';
|
|
218
|
+
ALTER USER supabase_auth_admin WITH PASSWORD :'pgpass';
|
|
219
|
+
ALTER USER supabase_functions_admin WITH PASSWORD :'pgpass';
|
|
220
|
+
ALTER USER supabase_storage_admin WITH PASSWORD :'pgpass';
|
|
221
|
+
`;
|
|
222
|
+
export const SUPABASE_DATABASE_JWT_SQL = `\\set jwt_secret \`echo "$JWT_SECRET"\`
|
|
223
|
+
\\set jwt_exp \`echo "$JWT_EXP"\`
|
|
224
|
+
|
|
225
|
+
ALTER DATABASE postgres SET "app.settings.jwt_secret" TO :'jwt_secret';
|
|
226
|
+
ALTER DATABASE postgres SET "app.settings.jwt_exp" TO :'jwt_exp';
|
|
227
|
+
`;
|
|
228
|
+
export const SUPABASE_DATABASE_REALTIME_SQL = `\\set pguser \`echo "$POSTGRES_USER"\`
|
|
229
|
+
|
|
230
|
+
create schema if not exists _realtime;
|
|
231
|
+
alter schema _realtime owner to :pguser;
|
|
232
|
+
`;
|
|
233
|
+
//# sourceMappingURL=databaseBootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databaseBootstrap.js","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/constants/databaseBootstrap.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoN7C,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;CAO1C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;CAKxC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;CAI7C,CAAC","sourcesContent":["export const SUPABASE_DATABASE_WEBHOOKS_SQL = `BEGIN;\n CREATE EXTENSION IF NOT EXISTS pg_net SCHEMA extensions;\n CREATE SCHEMA supabase_functions AUTHORIZATION supabase_admin;\n GRANT USAGE ON SCHEMA supabase_functions TO postgres, anon, authenticated, service_role;\n ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON TABLES TO postgres, anon, authenticated, service_role;\n ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON FUNCTIONS TO postgres, anon, authenticated, service_role;\n ALTER DEFAULT PRIVILEGES IN SCHEMA supabase_functions GRANT ALL ON SEQUENCES TO postgres, anon, authenticated, service_role;\n\n CREATE TABLE supabase_functions.migrations (\n version text PRIMARY KEY,\n inserted_at timestamptz NOT NULL DEFAULT NOW()\n );\n\n INSERT INTO supabase_functions.migrations (version) VALUES ('initial');\n\n CREATE TABLE supabase_functions.hooks (\n id bigserial PRIMARY KEY,\n hook_table_id integer NOT NULL,\n hook_name text NOT NULL,\n created_at timestamptz NOT NULL DEFAULT NOW(),\n request_id bigint\n );\n\n CREATE INDEX supabase_functions_hooks_request_id_idx ON supabase_functions.hooks USING btree (request_id);\n CREATE INDEX supabase_functions_hooks_h_table_id_h_name_idx ON supabase_functions.hooks USING btree (hook_table_id, hook_name);\n COMMENT ON TABLE supabase_functions.hooks IS 'Supabase Functions Hooks: Audit trail for triggered hooks.';\n\n CREATE FUNCTION supabase_functions.http_request()\n RETURNS trigger\n LANGUAGE plpgsql\n AS $function$\n DECLARE\n request_id bigint;\n payload jsonb;\n url text := TG_ARGV[0]::text;\n method text := TG_ARGV[1]::text;\n headers jsonb DEFAULT '{}'::jsonb;\n params jsonb DEFAULT '{}'::jsonb;\n timeout_ms integer DEFAULT 1000;\n BEGIN\n IF url IS NULL OR url = 'null' THEN\n RAISE EXCEPTION 'url argument is missing';\n END IF;\n\n IF method IS NULL OR method = 'null' THEN\n RAISE EXCEPTION 'method argument is missing';\n END IF;\n\n IF TG_ARGV[2] IS NULL OR TG_ARGV[2] = 'null' THEN\n headers = '{\"Content-Type\": \"application/json\"}'::jsonb;\n ELSE\n headers = TG_ARGV[2]::jsonb;\n END IF;\n\n IF TG_ARGV[3] IS NULL OR TG_ARGV[3] = 'null' THEN\n params = '{}'::jsonb;\n ELSE\n params = TG_ARGV[3]::jsonb;\n END IF;\n\n IF TG_ARGV[4] IS NULL OR TG_ARGV[4] = 'null' THEN\n timeout_ms = 1000;\n ELSE\n timeout_ms = TG_ARGV[4]::integer;\n END IF;\n\n CASE\n WHEN method = 'GET' THEN\n SELECT http_get INTO request_id FROM net.http_get(\n url,\n params,\n headers,\n timeout_ms\n );\n WHEN method = 'POST' THEN\n payload = jsonb_build_object(\n 'old_record', OLD,\n 'record', NEW,\n 'type', TG_OP,\n 'table', TG_TABLE_NAME,\n 'schema', TG_TABLE_SCHEMA\n );\n\n SELECT http_post INTO request_id FROM net.http_post(\n url,\n payload,\n params,\n headers,\n timeout_ms\n );\n ELSE\n RAISE EXCEPTION 'method argument % is invalid', method;\n END CASE;\n\n INSERT INTO supabase_functions.hooks\n (hook_table_id, hook_name, request_id)\n VALUES\n (TG_RELID, TG_NAME, request_id);\n\n RETURN NEW;\n END\n $function$;\n\n DO\n $$\n BEGIN\n IF NOT EXISTS (\n SELECT 1\n FROM pg_roles\n WHERE rolname = 'supabase_functions_admin'\n )\n THEN\n CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION;\n END IF;\n END\n $$;\n\n GRANT ALL PRIVILEGES ON SCHEMA supabase_functions TO supabase_functions_admin;\n GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA supabase_functions TO supabase_functions_admin;\n GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA supabase_functions TO supabase_functions_admin;\n ALTER USER supabase_functions_admin SET search_path = \"supabase_functions\";\n ALTER table \"supabase_functions\".migrations OWNER TO supabase_functions_admin;\n ALTER table \"supabase_functions\".hooks OWNER TO supabase_functions_admin;\n ALTER function \"supabase_functions\".http_request() OWNER TO supabase_functions_admin;\n GRANT supabase_functions_admin TO postgres;\n\n DO\n $$\n BEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_roles\n WHERE rolname = 'supabase_pg_net_admin'\n )\n THEN\n REASSIGN OWNED BY supabase_pg_net_admin TO supabase_admin;\n DROP OWNED BY supabase_pg_net_admin;\n DROP ROLE supabase_pg_net_admin;\n END IF;\n END\n $$;\n\n DO\n $$\n BEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_extension\n WHERE extname = 'pg_net'\n )\n THEN\n GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n END IF;\n END\n $$;\n\n CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access()\n RETURNS event_trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_event_trigger_ddl_commands() AS ev\n JOIN pg_extension AS ext\n ON ev.objid = ext.oid\n WHERE ext.extname = 'pg_net'\n )\n THEN\n GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n END IF;\n END;\n $$;\n\n COMMENT ON FUNCTION extensions.grant_pg_net_access IS 'Grants access to pg_net';\n\n DO\n $$\n BEGIN\n IF NOT EXISTS (\n SELECT 1\n FROM pg_event_trigger\n WHERE evtname = 'issue_pg_net_access'\n ) THEN\n CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end WHEN TAG IN ('CREATE EXTENSION')\n EXECUTE PROCEDURE extensions.grant_pg_net_access();\n END IF;\n END\n $$;\n\n INSERT INTO supabase_functions.migrations (version) VALUES ('20210809183423_update_grants');\n ALTER function supabase_functions.http_request() SECURITY DEFINER;\n ALTER function supabase_functions.http_request() SET search_path = supabase_functions;\n REVOKE ALL ON FUNCTION supabase_functions.http_request() FROM PUBLIC;\n GRANT EXECUTE ON FUNCTION supabase_functions.http_request() TO postgres, anon, authenticated, service_role;\nCOMMIT;\n`;\n\nexport const SUPABASE_DATABASE_ROLES_SQL = `\\\\set pgpass \\`echo \"$POSTGRES_PASSWORD\"\\`\n\nALTER USER authenticator WITH PASSWORD :'pgpass';\nALTER USER pgbouncer WITH PASSWORD :'pgpass';\nALTER USER supabase_auth_admin WITH PASSWORD :'pgpass';\nALTER USER supabase_functions_admin WITH PASSWORD :'pgpass';\nALTER USER supabase_storage_admin WITH PASSWORD :'pgpass';\n`;\n\nexport const SUPABASE_DATABASE_JWT_SQL = `\\\\set jwt_secret \\`echo \"$JWT_SECRET\"\\`\n\\\\set jwt_exp \\`echo \"$JWT_EXP\"\\`\n\nALTER DATABASE postgres SET \"app.settings.jwt_secret\" TO :'jwt_secret';\nALTER DATABASE postgres SET \"app.settings.jwt_exp\" TO :'jwt_exp';\n`;\n\nexport const SUPABASE_DATABASE_REALTIME_SQL = `\\\\set pguser \\`echo \"$POSTGRES_USER\"\\`\n\ncreate schema if not exists _realtime;\nalter schema _realtime owner to :pguser;\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.d.ts","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/constants/recovery.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,eAAe,CAAC;AACrD,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAChE,eAAO,MAAM,iCAAiC,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.js","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/constants/recovery.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC;AACrD,MAAM,CAAC,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;AAChE,MAAM,CAAC,MAAM,iCAAiC,GAAG,0BAA0B,CAAC","sourcesContent":["export const SUPABASE_RECOVERY_SCHEMA = '_ankhorage';\nexport const SUPABASE_RECOVERY_STATE_TABLE = 'database_restore';\nexport const SUPABASE_DATA_RESTORE_WORKLOAD_ID = 'supabase-db-data-restore';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const SUPABASE_BOOTSTRAP_CREDENTIAL: {
|
|
2
|
+
readonly source: "control-plane";
|
|
3
|
+
readonly name: "SUPABASE_BOOTSTRAP";
|
|
4
|
+
};
|
|
5
|
+
export declare const SUPABASE_IMAGES: {
|
|
6
|
+
readonly database: "supabase/postgres:17.6.1.136";
|
|
7
|
+
readonly auth: "supabase/gotrue:v2.196.0";
|
|
8
|
+
readonly rest: "postgrest/postgrest:v14.17";
|
|
9
|
+
readonly realtime: "supabase/realtime:v2.134.10";
|
|
10
|
+
readonly storage: "supabase/storage-api:v1.74.0";
|
|
11
|
+
readonly imgproxy: "darthsim/imgproxy:v3.31.4";
|
|
12
|
+
readonly meta: "supabase/postgres-meta:v0.99.0";
|
|
13
|
+
readonly gateway: "envoyproxy/envoy:v1.39.1";
|
|
14
|
+
readonly studio: "supabase/studio:2026.09.07-sha-7996410";
|
|
15
|
+
};
|
|
16
|
+
export declare const SUPABASE_ENVOY_CONFIG = "static_resources:\n listeners:\n - name: supabase\n address:\n socket_address:\n address: 0.0.0.0\n port_value: 8000\n filter_chains:\n - filters:\n - name: envoy.filters.network.http_connection_manager\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager\n stat_prefix: supabase\n normalize_path: true\n merge_slashes: true\n upgrade_configs:\n - upgrade_type: websocket\n route_config:\n name: supabase\n virtual_hosts:\n - name: supabase\n domains: [\"*\"]\n cors:\n allow_origin_string_match:\n - safe_regex:\n regex: \".*\"\n allow_methods: \"GET,POST,PUT,PATCH,DELETE,OPTIONS,HEAD\"\n allow_headers: \"*\"\n routes:\n - match: { prefix: \"/auth/v1/\" }\n route: { cluster: auth, prefix_rewrite: \"/\", timeout: 30s }\n - match: { prefix: \"/rest/v1/\" }\n route: { cluster: rest, prefix_rewrite: \"/\", timeout: 30s }\n - match: { prefix: \"/realtime/v1/\" }\n route: { cluster: realtime, prefix_rewrite: \"/\", timeout: 30s }\n - match: { prefix: \"/storage/v1/\" }\n route: { cluster: storage, prefix_rewrite: \"/\", timeout: 30s }\n http_filters:\n - name: envoy.filters.http.cors\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors\n - name: envoy.filters.http.router\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router\n clusters:\n - name: auth\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: auth\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-auth, port_value: 9999 } }\n - name: rest\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: rest\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-rest, port_value: 3000 } }\n - name: realtime\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: realtime\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-realtime, port_value: 4000 } }\n - name: storage\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: storage\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-storage, port_value: 5000 } }\n";
|
|
17
|
+
export declare const SUPABASE_ENVOY_CONFIG_WITHOUT_STORAGE = "static_resources:\n listeners:\n - name: supabase\n address:\n socket_address:\n address: 0.0.0.0\n port_value: 8000\n filter_chains:\n - filters:\n - name: envoy.filters.network.http_connection_manager\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager\n stat_prefix: supabase\n normalize_path: true\n merge_slashes: true\n upgrade_configs:\n - upgrade_type: websocket\n route_config:\n name: supabase\n virtual_hosts:\n - name: supabase\n domains: [\"*\"]\n cors:\n allow_origin_string_match:\n - safe_regex:\n regex: \".*\"\n allow_methods: \"GET,POST,PUT,PATCH,DELETE,OPTIONS,HEAD\"\n allow_headers: \"*\"\n routes:\n - match: { prefix: \"/auth/v1/\" }\n route: { cluster: auth, prefix_rewrite: \"/\", timeout: 30s }\n - match: { prefix: \"/rest/v1/\" }\n route: { cluster: rest, prefix_rewrite: \"/\", timeout: 30s }\n - match: { prefix: \"/realtime/v1/\" }\n route: { cluster: realtime, prefix_rewrite: \"/\", timeout: 30s }\n http_filters:\n - name: envoy.filters.http.cors\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors\n - name: envoy.filters.http.router\n typed_config:\n \"@type\": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router\n clusters:\n - name: auth\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: auth\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-auth, port_value: 9999 } }\n - name: rest\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: rest\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-rest, port_value: 3000 } }\n - name: realtime\n connect_timeout: 5s\n type: STRICT_DNS\n load_assignment:\n cluster_name: realtime\n endpoints:\n - lb_endpoints:\n - endpoint:\n address: { socket_address: { address: supabase-realtime, port_value: 4000 } }\n";
|
|
18
|
+
//# sourceMappingURL=supabase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../../../src/features/platform-infrastructure/constants/supabase.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;CAGhC,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;;;;;CAUlB,CAAC;AA2FX,eAAO,MAAM,qBAAqB,yvGAA8J,CAAC;AAEjM,eAAO,MAAM,qCAAqC,qzFAA8F,CAAC"}
|