@substrat-run/contracts 0.34.0 → 0.36.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.
@@ -78,4 +78,66 @@ export declare const archiveScopePayload: z.ZodObject<{
78
78
  export type ArchiveScopePayload = z.infer<typeof archiveScopePayload>;
79
79
  /** The well-known intent kind string for `archiveScopePayload`. */
80
80
  export declare const ARCHIVE_SCOPE_KIND = "archive-scope";
81
+ /**
82
+ * One entitlement a manager vertical asks the platform to grant (#412) — the SKU key plus
83
+ * its tier grouping. `plan: null` = an ungrouped on/off flag. Deliberately NOT the full
84
+ * `entitlementGrantInput` (no quota/expiry): a manager names WHAT a customer bought; how
85
+ * a key meters is platform/console policy.
86
+ */
87
+ export declare const entitlementSelection: z.ZodObject<{
88
+ key: z.ZodString;
89
+ plan: z.ZodNullable<z.ZodString>;
90
+ }, z.core.$strip>;
91
+ export type EntitlementSelection = z.infer<typeof entitlementSelection>;
92
+ /**
93
+ * The `provision-tenant` intent kind (#412) — a MANAGER vertical (a console whose job is to
94
+ * add tenants, e.g. the AuthHero console) asking the platform to create a NEW customer
95
+ * tenant, its first scope running a (possibly different) vertical, and its entitlements.
96
+ * Unlike `provision-sibling`, the target tenant does not exist yet, so the drained scope
97
+ * proves nothing about it — admissibility is bounded on the MANAGER instead (a
98
+ * platform-granted provisioner capability + its declared SKU universe; platform-drain.ts).
99
+ * All ids are proposed by the vertical as idempotent join keys: a retry after a partial
100
+ * failure converges on the same tenant/scope instead of minting duplicates.
101
+ */
102
+ export declare const provisionTenantPayload: z.ZodObject<{
103
+ tenant: z.ZodObject<{
104
+ id: z.ZodString;
105
+ slug: z.ZodString;
106
+ name: z.ZodString;
107
+ }, z.core.$strip>;
108
+ instance: z.ZodObject<{
109
+ vertical: z.ZodString;
110
+ scopeId: z.ZodString;
111
+ slug: z.ZodString;
112
+ name: z.ZodString;
113
+ owner: z.ZodString;
114
+ }, z.core.$strip>;
115
+ entitlements: z.ZodArray<z.ZodObject<{
116
+ key: z.ZodString;
117
+ plan: z.ZodNullable<z.ZodString>;
118
+ }, z.core.$strip>>;
119
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
120
+ }, z.core.$strip>;
121
+ export type ProvisionTenantPayload = z.infer<typeof provisionTenantPayload>;
122
+ /** The well-known intent kind string for `provisionTenantPayload`. */
123
+ export declare const PROVISION_TENANT_KIND = "provision-tenant";
124
+ /**
125
+ * The `set-entitlements` intent kind (#412) — reconcile a managed tenant's grants to a
126
+ * plan's TARGET set. The payload names the target; the platform grants what is present and
127
+ * revokes any key in the manager's declared SKU universe that is absent — so the declared
128
+ * set bounds BOTH sides and a downgrade revokes cleanly. `authScopeId` is the scope the
129
+ * new set is re-projected into (the vertical's #310 projection is a full replace).
130
+ */
131
+ export declare const setEntitlementsPayload: z.ZodObject<{
132
+ tenantId: z.ZodString;
133
+ authScopeId: z.ZodString;
134
+ plan: z.ZodString;
135
+ entitlements: z.ZodArray<z.ZodObject<{
136
+ key: z.ZodString;
137
+ plan: z.ZodNullable<z.ZodString>;
138
+ }, z.core.$strip>>;
139
+ }, z.core.$strip>;
140
+ export type SetEntitlementsPayload = z.infer<typeof setEntitlementsPayload>;
141
+ /** The well-known intent kind string for `setEntitlementsPayload`. */
142
+ export declare const SET_ENTITLEMENTS_KIND = "set-entitlements";
81
143
  //# sourceMappingURL=platform-request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-request.d.ts","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AAEH,eAAO,MAAM,qBAAqB;;;;EAAwC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,oBAAo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E9D;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;iBAAwB,CAAC;AACzD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;iBAkBjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,qBAAqB,CAAC"}
@@ -61,4 +61,60 @@ export const PROVISION_SIBLING_KIND = 'provision-sibling';
61
61
  export const archiveScopePayload = z.object({ scopeId });
62
62
  /** The well-known intent kind string for `archiveScopePayload`. */
63
63
  export const ARCHIVE_SCOPE_KIND = 'archive-scope';
64
+ /**
65
+ * One entitlement a manager vertical asks the platform to grant (#412) — the SKU key plus
66
+ * its tier grouping. `plan: null` = an ungrouped on/off flag. Deliberately NOT the full
67
+ * `entitlementGrantInput` (no quota/expiry): a manager names WHAT a customer bought; how
68
+ * a key meters is platform/console policy.
69
+ */
70
+ export const entitlementSelection = z.object({
71
+ key: z.string().min(1),
72
+ plan: z.string().min(1).nullable(),
73
+ });
74
+ /**
75
+ * The `provision-tenant` intent kind (#412) — a MANAGER vertical (a console whose job is to
76
+ * add tenants, e.g. the AuthHero console) asking the platform to create a NEW customer
77
+ * tenant, its first scope running a (possibly different) vertical, and its entitlements.
78
+ * Unlike `provision-sibling`, the target tenant does not exist yet, so the drained scope
79
+ * proves nothing about it — admissibility is bounded on the MANAGER instead (a
80
+ * platform-granted provisioner capability + its declared SKU universe; platform-drain.ts).
81
+ * All ids are proposed by the vertical as idempotent join keys: a retry after a partial
82
+ * failure converges on the same tenant/scope instead of minting duplicates.
83
+ */
84
+ export const provisionTenantPayload = z.object({
85
+ tenant: z.object({
86
+ id: z.string().min(1),
87
+ slug: z.string().min(1),
88
+ name: z.string().min(1),
89
+ }),
90
+ /** The tenant's FIRST scope. `vertical` comes from the payload, never inherited. */
91
+ instance: z.object({
92
+ vertical: z.string().min(1),
93
+ scopeId: z.string().min(1),
94
+ slug: z.string().min(1),
95
+ name: z.string().min(1),
96
+ owner: z.string().min(1),
97
+ }),
98
+ /** SKUs to grant the new tenant + project into the scope (#310). */
99
+ entitlements: z.array(entitlementSelection),
100
+ /** Per-instance settings, delivered via the vertical's `/internal/configure` when present. */
101
+ config: z.record(z.string(), z.string()).optional(),
102
+ });
103
+ /** The well-known intent kind string for `provisionTenantPayload`. */
104
+ export const PROVISION_TENANT_KIND = 'provision-tenant';
105
+ /**
106
+ * The `set-entitlements` intent kind (#412) — reconcile a managed tenant's grants to a
107
+ * plan's TARGET set. The payload names the target; the platform grants what is present and
108
+ * revokes any key in the manager's declared SKU universe that is absent — so the declared
109
+ * set bounds BOTH sides and a downgrade revokes cleanly. `authScopeId` is the scope the
110
+ * new set is re-projected into (the vertical's #310 projection is a full replace).
111
+ */
112
+ export const setEntitlementsPayload = z.object({
113
+ tenantId: z.string().min(1),
114
+ authScopeId: z.string().min(1),
115
+ plan: z.string().min(1),
116
+ entitlements: z.array(entitlementSelection),
117
+ });
118
+ /** The well-known intent kind string for `setEntitlementsPayload`. */
119
+ export const SET_ENTITLEMENTS_KIND = 'set-entitlements';
64
120
  //# sourceMappingURL=platform-request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-request.js","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAGH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,iBAAiB;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,WAAW,EAAE,KAAK,EAAE,kFAAkF;IACtG,MAAM,EAAE,qBAAqB;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EA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ACzB,CAAC;IACF,oEAAoE;IACpE,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;IAC3C,8FAA8F;IAC9F,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAGH,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;CAC5C,CAAC,CAAC;AAGH,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/contracts",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "description": "Substrat kernel contract schemas — Zod is the source of truth (master plan D-22); OAS/JSON Schema are emitted artifacts",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {