@wildo-ai/platform-config-lib 1.1.14 → 1.1.15
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/dist/esm/bootstrap/application-scheduled-jobs.contracts.d.ts +187 -0
- package/dist/esm/bootstrap/application-scheduled-jobs.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/application-scheduled-jobs.contracts.js +250 -0
- package/dist/esm/bootstrap/application-scheduled-jobs.contracts.js.map +1 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +23 -2
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js +23 -4
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +12 -1
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js +8 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +1 -0
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +13 -0
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +39 -0
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts +7 -3
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +10 -4
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +18 -4
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +26 -4
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -115,6 +115,7 @@ export declare const SaasRuntimeProvidersArtifactSchema: z.ZodObject<{
|
|
|
115
115
|
basePackageVersion: z.ZodOptional<z.ZodString>;
|
|
116
116
|
}, z.core.$strict>>>>;
|
|
117
117
|
providerProcessingRegions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
118
|
+
providerFrameOrigins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
118
119
|
providerDataResidency: z.ZodOptional<z.ZodObject<{
|
|
119
120
|
territories: z.ZodArray<z.ZodString>;
|
|
120
121
|
storedAtRestTerritories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -368,6 +369,11 @@ export declare function assertProviderProcessingInsideDataResidency(input: {
|
|
|
368
369
|
}): void;
|
|
369
370
|
/** Every provider ref a data-serving scope declares, sorted. See {@link SCOPE_SERVES_APPLICATION_DATA}. */
|
|
370
371
|
export declare function dataServingProviderRefs(scopes: SaasProvidersScopes): string[];
|
|
372
|
+
/**
|
|
373
|
+
* The frame origins of the given providers (#4002), from their contributions' `frontendFrameOrigins`, or `undefined` when
|
|
374
|
+
* none frames a page. Keyed by ref and sorted, so the artifact is stable.
|
|
375
|
+
*/
|
|
376
|
+
export declare function materializeProviderFrameOrigins(contributions: readonly Pick<DiscoveredProviderCompanionContribution, 'ref' | 'frontendFrameOrigins'>[], providerRefs: readonly string[]): Record<string, string[]> | undefined;
|
|
371
377
|
/** The region map restricted to the given refs, or `undefined` when none remain — the shape every per-host artifact carries. */
|
|
372
378
|
export declare function narrowProviderProcessingRegions(regions: Readonly<Record<string, string>> | undefined, providerRefs: readonly string[]): Record<string, string> | undefined;
|
|
373
379
|
export declare function selectScopedProviderRuntimeArtifact(artifact: SaasRuntimeProvidersArtifact, scopeKey: string): SaasRuntimeProvidersArtifact;
|
|
@@ -387,6 +393,13 @@ export declare function narrowRuntimeAugmentations(augmentations: SaasRuntimePro
|
|
|
387
393
|
* `PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS`).
|
|
388
394
|
*/
|
|
389
395
|
export declare function resolveFrontendServicesArtifactPath(saasRoot: string): string;
|
|
396
|
+
/**
|
|
397
|
+
* The frame origins the backend's providers declared (#4002), read from the materialized backend artifact: `providerRef`
|
|
398
|
+
* -> origins, empty when the artifact is missing (a clean checkout, before any sync) or records none. An artifact that
|
|
399
|
+
* no longer parses is refused with its remedy, like the frontend-services reader below, rather than read as "none":
|
|
400
|
+
* that would publish a policy blocking the signing frame.
|
|
401
|
+
*/
|
|
402
|
+
export declare function loadMaterializedBackendProviderFrameOrigins(saasRoot: string): Readonly<Record<string, readonly string[]>>;
|
|
390
403
|
/**
|
|
391
404
|
* Read + project the materialized frontend-services artifact for the
|
|
392
405
|
* given service key. Returns `undefined` if the artifact file is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-runtime-artifacts.d.ts","sourceRoot":"","sources":["../../../src/project-config/provider-runtime-artifacts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAqBL,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EAEzC,KAAK,+BAA+B,EAEpC,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,4BAA4B,EAElC,MAAM,4CAA4C,CAAC;AAOpD,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAI7C,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,+CAA+C,2EACc,CAAC;AAE3E,eAAO,MAAM,mCAAmC,oCAAoC,CAAC;AAErF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wCAAwC;;;;;;CAM3C,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,+CAA+C;;;;;;CAMlD,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,MAAM,OAAO,wCAAwC,CAAC;AAEhG,eAAO,MAAM,+CAA+C,sDACP,CAAC;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,EAAG,kCAA2C,CAAC;AAEtF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wCAAwC,yBAAyB,CAAC;AAe/E,QAAA,MAAM,oCAAoC;;;;;;;kBAUxC,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AA4BlG;;;;;;;;;GASG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;kBAapD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,eAAO,MAAM,kCAAkC
|
|
1
|
+
{"version":3,"file":"provider-runtime-artifacts.d.ts","sourceRoot":"","sources":["../../../src/project-config/provider-runtime-artifacts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAqBL,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EAEzC,KAAK,+BAA+B,EAEpC,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,4BA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2C,CACzD,SAAS,EAAE,wCAAwC,CAAC,WAAW,CAAC,GAC/D,OAAO,CAGT"}
|
|
@@ -189,6 +189,15 @@ export const SaasRuntimeProvidersArtifactSchema = z.strictObject({
|
|
|
189
189
|
* when none remain.
|
|
190
190
|
*/
|
|
191
191
|
providerProcessingRegions: z.record(z.string().min(1), z.string().min(1)).optional(),
|
|
192
|
+
/**
|
|
193
|
+
* `providerRef` -> the origins of the vendor pages that provider shows inside the application's frontend (#4002), for
|
|
194
|
+
* the BACKEND's providers only: today the signing page `EmbeddedSigningFrame` frames. Read from each provider's
|
|
195
|
+
* companion contribution (`frontendFrameOrigins`), never restated, and read by `wildo dev sync-csp`, which adds them to
|
|
196
|
+
* the `frame-src` of the application's SaaS frontends. No runtime reads it: the engine checks a signing page against
|
|
197
|
+
* the module's own declaration. Absent when no backend provider frames a page, so every other application's artifact
|
|
198
|
+
* is byte-identical to before.
|
|
199
|
+
*/
|
|
200
|
+
providerFrameOrigins: z.record(z.string().min(1), z.array(z.string().min(1)).min(1)).optional(),
|
|
192
201
|
/**
|
|
193
202
|
* The declared data residency and the choice of every provider in this artifact (#2294), for the hosts that load
|
|
194
203
|
* providers to serve the application's data (backend, minions, node workers). Their provider loader re-applies the
|
|
@@ -416,6 +425,19 @@ function runtimeScopesOfKind(scopes, kind) {
|
|
|
416
425
|
return Object.values(scopes[kind] ?? {});
|
|
417
426
|
}
|
|
418
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* The frame origins of the given providers (#4002), from their contributions' `frontendFrameOrigins`, or `undefined` when
|
|
430
|
+
* none frames a page. Keyed by ref and sorted, so the artifact is stable.
|
|
431
|
+
*/
|
|
432
|
+
export function materializeProviderFrameOrigins(contributions, providerRefs) {
|
|
433
|
+
const origins = {};
|
|
434
|
+
for (const providerRef of [...providerRefs].sort((left, right) => left.localeCompare(right))) {
|
|
435
|
+
const declared = contributions.find((contribution) => contribution.ref === providerRef)?.frontendFrameOrigins ?? [];
|
|
436
|
+
if (declared.length > 0)
|
|
437
|
+
origins[providerRef] = [...new Set(declared)].sort((left, right) => left.localeCompare(right));
|
|
438
|
+
}
|
|
439
|
+
return Object.keys(origins).length === 0 ? undefined : origins;
|
|
440
|
+
}
|
|
419
441
|
/** The region map restricted to the given refs, or `undefined` when none remain — the shape every per-host artifact carries. */
|
|
420
442
|
export function narrowProviderProcessingRegions(regions, providerRefs) {
|
|
421
443
|
const narrowed = Object.entries(regions ?? {}).filter(([providerRef]) => providerRefs.includes(providerRef));
|
|
@@ -487,6 +509,21 @@ export function narrowRuntimeAugmentations(augmentations, providerRefs) {
|
|
|
487
509
|
export function resolveFrontendServicesArtifactPath(saasRoot) {
|
|
488
510
|
return resolvePath(saasRoot, PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS.frontendServices);
|
|
489
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* The frame origins the backend's providers declared (#4002), read from the materialized backend artifact: `providerRef`
|
|
514
|
+
* -> origins, empty when the artifact is missing (a clean checkout, before any sync) or records none. An artifact that
|
|
515
|
+
* no longer parses is refused with its remedy, like the frontend-services reader below, rather than read as "none":
|
|
516
|
+
* that would publish a policy blocking the signing frame.
|
|
517
|
+
*/
|
|
518
|
+
export function loadMaterializedBackendProviderFrameOrigins(saasRoot) {
|
|
519
|
+
const artifactPath = resolvePath(saasRoot, PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS.backend);
|
|
520
|
+
if (!existsSync(artifactPath))
|
|
521
|
+
return {};
|
|
522
|
+
const parsedArtifact = SaasRuntimeProvidersArtifactSchema.safeParse(JSON.parse(readFileSync(artifactPath, 'utf8')));
|
|
523
|
+
if (!parsedArtifact.success)
|
|
524
|
+
throw staleGeneratedArtifactError(artifactPath, parsedArtifact.error.issues);
|
|
525
|
+
return parsedArtifact.data.providerFrameOrigins ?? {};
|
|
526
|
+
}
|
|
490
527
|
/**
|
|
491
528
|
* Read + project the materialized frontend-services artifact for the
|
|
492
529
|
* given service key. Returns `undefined` if the artifact file is
|
|
@@ -735,6 +772,7 @@ function materializeRuntimeArtifacts(input) {
|
|
|
735
772
|
metadata: artifactMetadata.backend,
|
|
736
773
|
processingRegions: input.processingRegions,
|
|
737
774
|
dataResidency: input.dataResidency,
|
|
775
|
+
frameOrigins: materializeProviderFrameOrigins(discoveryContext.contributions, artifactMetadata.backend.providerRefs),
|
|
738
776
|
// Only the HTTP-facing backend map uses public names. Static artifacts below
|
|
739
777
|
// deliberately retain declaration keys for build-time scope selection.
|
|
740
778
|
frontendProviderBootstraps: backendBootstraps && Object.fromEntries(Object.entries(backendBootstraps).map(([serviceKey, block]) => [input.frontendServiceNames[serviceKey], block])),
|
|
@@ -800,6 +838,7 @@ function materializeRuntimeArtifactFile(input) {
|
|
|
800
838
|
systemOfRecordFacetModules: input.metadata.systemOfRecordFacetModules,
|
|
801
839
|
providerRuntimeAugmentations: input.metadata.providerRuntimeAugmentations,
|
|
802
840
|
providerProcessingRegions: narrowProviderProcessingRegions(input.processingRegions, input.metadata.providerRefs),
|
|
841
|
+
providerFrameOrigins: input.frameOrigins,
|
|
803
842
|
providerDataResidency: input.dataResidency === undefined
|
|
804
843
|
? undefined
|
|
805
844
|
: runtimeProviderDataResidencyFor({ ...input.dataResidency, providerRefs: input.metadata.providerRefs }),
|