@xemahq/platform-common 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
1
  export * from './artifact-versioning-mode';
2
2
  export * from './llm-gateway';
3
3
  export * from './webapp-studio';
4
- export * from './scope-source';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/enums/index.ts"],"names":[],"mappings":"AAGA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/enums/index.ts"],"names":[],"mappings":"AAGA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
@@ -17,5 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./artifact-versioning-mode"), exports);
18
18
  __exportStar(require("./llm-gateway"), exports);
19
19
  __exportStar(require("./webapp-studio"), exports);
20
- __exportStar(require("./scope-source"), exports);
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,6DAA2C;AAC3C,gDAA8B;AAC9B,kDAAgC;AAChC,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,6DAA2C;AAC3C,gDAA8B;AAC9B,kDAAgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/platform-common",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Shared NestJS building blocks for Xema services — auth guards, response redaction, CORS configuration, and crypto helpers.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
@@ -62,7 +62,7 @@
62
62
  "rxjs": "7.8.2",
63
63
  "ts-jest": "^29.4.9",
64
64
  "typescript": "5.9.3",
65
- "@xemahq/kernel-contracts": "^18.2.0"
65
+ "@xemahq/kernel-contracts": "^19.0.0"
66
66
  },
67
67
  "exports": {
68
68
  ".": {
@@ -1,24 +0,0 @@
1
- export declare enum ScopeSource {
2
- System = "system",
3
- Biome = "biome",
4
- Org = "org",
5
- Project = "project",
6
- User = "user"
7
- }
8
- export declare const SCOPE_RESOLUTION_ORDER: readonly ScopeSource[];
9
- export declare const SCOPE_PRECEDENCE_RANK: Readonly<Record<ScopeSource, number>>;
10
- export declare function isScopeSource(value: unknown): value is ScopeSource;
11
- export declare const SCOPE_PROMOTION_TARGETS: Readonly<Record<ScopeSource, readonly ScopeSource[]>>;
12
- export declare function isLegalScopePromotion(from: ScopeSource, to: ScopeSource): boolean;
13
- export interface ScopeOwnerIdentity {
14
- readonly projectId?: string | null;
15
- readonly ownerUserId?: string | null;
16
- }
17
- export declare function buildForkedFromToken(source: ScopeSource.System | ScopeSource.Biome, biomeId: string | null, slug: string): string;
18
- export interface ForkedFromToken {
19
- readonly source: ScopeSource.System | ScopeSource.Biome;
20
- readonly biomeId: string | null;
21
- readonly slug: string;
22
- }
23
- export declare function parseForkedFromToken(token: string): ForkedFromToken | null;
24
- //# sourceMappingURL=scope-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope-source.d.ts","sourceRoot":"","sources":["../../../src/lib/enums/scope-source.ts"],"names":[],"mappings":"AA2BA,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAMD,eAAO,MAAM,sBAAsB,EAAE,SAAS,WAAW,EAMxD,CAAC;AAOF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAMvE,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAQlE;AAuBD,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,MAAM,CAAC,WAAW,EAAE,SAAS,WAAW,EAAE,CAAC,CAO5C,CAAC;AAOF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,WAAW,GACd,OAAO,CAKT;AAOD,MAAM,WAAW,kBAAkB;IAEjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAaD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,EAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,GACX,MAAM,CAKR;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAY1E"}
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SCOPE_PROMOTION_TARGETS = exports.SCOPE_PRECEDENCE_RANK = exports.SCOPE_RESOLUTION_ORDER = exports.ScopeSource = void 0;
4
- exports.isScopeSource = isScopeSource;
5
- exports.isLegalScopePromotion = isLegalScopePromotion;
6
- exports.buildForkedFromToken = buildForkedFromToken;
7
- exports.parseForkedFromToken = parseForkedFromToken;
8
- var ScopeSource;
9
- (function (ScopeSource) {
10
- ScopeSource["System"] = "system";
11
- ScopeSource["Biome"] = "biome";
12
- ScopeSource["Org"] = "org";
13
- ScopeSource["Project"] = "project";
14
- ScopeSource["User"] = "user";
15
- })(ScopeSource || (exports.ScopeSource = ScopeSource = {}));
16
- exports.SCOPE_RESOLUTION_ORDER = [
17
- ScopeSource.User,
18
- ScopeSource.Project,
19
- ScopeSource.Org,
20
- ScopeSource.Biome,
21
- ScopeSource.System,
22
- ];
23
- exports.SCOPE_PRECEDENCE_RANK = {
24
- [ScopeSource.User]: 0,
25
- [ScopeSource.Project]: 1,
26
- [ScopeSource.Org]: 2,
27
- [ScopeSource.Biome]: 3,
28
- [ScopeSource.System]: 4,
29
- };
30
- function isScopeSource(value) {
31
- return (value === ScopeSource.System ||
32
- value === ScopeSource.Biome ||
33
- value === ScopeSource.Org ||
34
- value === ScopeSource.Project ||
35
- value === ScopeSource.User);
36
- }
37
- exports.SCOPE_PROMOTION_TARGETS = {
38
- [ScopeSource.User]: [ScopeSource.Project, ScopeSource.Org],
39
- [ScopeSource.Project]: [ScopeSource.Org],
40
- [ScopeSource.Org]: [],
41
- [ScopeSource.Biome]: [],
42
- [ScopeSource.System]: [],
43
- };
44
- function isLegalScopePromotion(from, to) {
45
- if (from === to) {
46
- return false;
47
- }
48
- return exports.SCOPE_PROMOTION_TARGETS[from].includes(to);
49
- }
50
- function buildForkedFromToken(source, biomeId, slug) {
51
- if (source === ScopeSource.Biome && !biomeId) {
52
- throw new Error('buildForkedFromToken: biomeId required when source=biome');
53
- }
54
- return `${source}:${biomeId ?? ''}:${slug}`;
55
- }
56
- function parseForkedFromToken(token) {
57
- const parts = token.split(':');
58
- if (parts.length !== 3)
59
- return null;
60
- const [sourceRaw, biomeId, slug] = parts;
61
- if (sourceRaw !== ScopeSource.System && sourceRaw !== ScopeSource.Biome)
62
- return null;
63
- if (!slug)
64
- return null;
65
- if (sourceRaw === ScopeSource.Biome && !biomeId)
66
- return null;
67
- return {
68
- source: sourceRaw,
69
- biomeId: sourceRaw === ScopeSource.Biome ? biomeId : null,
70
- slug,
71
- };
72
- }
73
- //# sourceMappingURL=scope-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope-source.js","sourceRoot":"","sources":["../../../src/lib/enums/scope-source.ts"],"names":[],"mappings":";;;AA4DA,sCAQC;AAsCD,sDAQC;AAyBD,oDASC;AAQD,oDAYC;AA7ID,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,kCAAmB,CAAA;IACnB,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAMY,QAAA,sBAAsB,GAA2B;IAC5D,WAAW,CAAC,IAAI;IAChB,WAAW,CAAC,OAAO;IACnB,WAAW,CAAC,GAAG;IACf,WAAW,CAAC,KAAK;IACjB,WAAW,CAAC,MAAM;CACnB,CAAC;AAOW,QAAA,qBAAqB,GAA0C;IAC1E,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;IACrB,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IACxB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;IACpB,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IACtB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;CACxB,CAAC;AAEF,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,CACL,KAAK,KAAK,WAAW,CAAC,MAAM;QAC5B,KAAK,KAAK,WAAW,CAAC,KAAK;QAC3B,KAAK,KAAK,WAAW,CAAC,GAAG;QACzB,KAAK,KAAK,WAAW,CAAC,OAAO;QAC7B,KAAK,KAAK,WAAW,CAAC,IAAI,CAC3B,CAAC;AACJ,CAAC;AAuBY,QAAA,uBAAuB,GAEhC;IACF,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,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