@nativestudio/sdk 0.3.0-rc.20 → 0.3.0-rc.21
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/COMPATIBILITY.json +4 -4
- package/dist/_chunks/{chunk-VI7HPZJC.js → chunk-2QDPFLIO.js} +1 -1
- package/dist/_chunks/chunk-7DXSLHXW.js +1 -0
- package/dist/_chunks/{chunk-D3KLEDOI.js → chunk-ASUZJSEP.js} +1 -1
- package/dist/_chunks/{chunk-3Q24IPBK.js → chunk-K3TIFCD3.js} +1 -1
- package/dist/_chunks/{chunk-O6YL4JVI.js → chunk-NNDKZ5H5.js} +1 -1
- package/dist/_chunks/chunk-Q53Q74OP.js +1 -0
- package/dist/_chunks/chunk-UKPD77FB.js +1 -0
- package/dist/_chunks/chunk-VXBIT7XN.js +1 -0
- package/dist/_chunks/{chunk-SXZY76XB.js → chunk-WNXKJRZ6.js} +1 -1
- package/dist/_types/contracts/interface/operation.d.ts +59 -0
- package/dist/_types/contracts/interface/production-snapshot.d.ts +25 -0
- package/dist/_types/contracts/interface/query.d.ts +25 -0
- package/dist/_types/contracts/lifecycle-event-projections.d.ts +2 -2
- package/dist/_types/contracts/navigation-context.d.ts +49 -1
- package/dist/_types/contracts/navigation.d.ts +1 -1
- package/dist/_types/sdk/catalog/core.d.ts +108 -0
- package/dist/_types/sdk/catalog/federation.d.ts +223 -40
- package/dist/_types/sdk/catalog/lifecycle-events.d.ts +2 -2
- package/dist/_types/sdk/catalog/mcp.d.ts +3 -0
- package/dist/_types/sdk/catalog/navigation.d.ts +86 -4
- package/dist/_types/sdk/catalog/reference-preview.d.ts +36 -0
- package/dist/_types/sdk/navigation-facade.d.ts +103 -3
- package/dist/_types/sdk/observe.d.ts +18 -0
- package/dist/host-protocol.js +1 -1
- package/dist/index.js +1 -1
- package/dist/local-runtime.js +1 -1
- package/dist/mcp-discovery.js +1 -1
- package/dist/runtime-authority.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/chunk-GJULDJSV.js +0 -1
- package/dist/_chunks/chunk-OHONXDFL.js +0 -1
- package/dist/_chunks/chunk-S64F3WZK.js +0 -1
- package/dist/_chunks/chunk-XNROPEWC.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ExternalLifecycleEventSchema,FederationScopeSchema,orderedFederationWindow}from"./chunk-O6YL4JVI.js";import{z as z3}from"zod";import{z as z2}from"zod";import{z}from"zod";var clean=v=>Array.from(v).every(c=>{const n=c.codePointAt(0);return n>=32&&n!==127&&(n<55296||n>57343)});var FederationPeerRefSchema=z.string().min(1).max(256).refine(clean);var FederationOpaqueUriSchema=z.string().min(1).max(512).refine(v=>clean(v)&&URL.canParse(v)&&!/\s/u.test(v));var RESOURCE_CHANGE_TYPE="com.nativestudio.federation.resource.changed.v1";var RESOURCE_CHANGE_SCHEMA="urn:nativestudio:federation:resource-change:v1";var FederationSourceScopeSchema=z.strictObject({namespace:FederationPeerRefSchema,ref:FederationPeerRefSchema});var ResourceChangeSchema=z.strictObject({schemaVersion:z.literal(1),sourceScope:FederationSourceScopeSchema,resource:z.strictObject({namespace:FederationPeerRefSchema,ref:FederationOpaqueUriSchema,version:FederationPeerRefSchema}),changeKind:FederationPeerRefSchema,parentRef:FederationOpaqueUriSchema.nullable().optional()});var distinct=a=>new Set(a).size===a.length;var FederationSourceSelectionSchema=z.strictObject({scope:FederationSourceScopeSchema,resourceNamespace:FederationPeerRefSchema,changeKinds:z.array(FederationPeerRefSchema).min(1).max(32).refine(distinct),resourcePrefixes:z.array(FederationOpaqueUriSchema).min(1).max(16).refine(distinct)});var HistoricalSourceScopeSchema=z.record(FederationPeerRefSchema,FederationPeerRefSchema).refine(v=>Object.keys(v).length<=32);var HistoricalSourceSelectionSchema=z.record(FederationPeerRefSchema,z.union([FederationPeerRefSchema,z.array(z.string().min(1).max(512).refine(clean)).max(32),HistoricalSourceScopeSchema])).refine(v=>Object.keys(v).length<=32&&JSON.stringify(v).length<=32768);var uuid=z2.uuid().toLowerCase();var clean2=v=>Array.from(v).every(c=>{const code=c.codePointAt(0);return code>=32&&code!==127&&(code<55296||code>57343)});var ref=z2.string().min(1).max(256).refine(clean2);var uri=z2.string().min(1).max(2048).refine(v=>URL.canParse(v)&&!/\s/.test(v)&&clean2(v));var bindingInput=FederationScopeSchema.extend({connectionRef:ref.optional(),bindingId:uuid,requestId:ref,expectedRevision:z2.int().nonnegative(),source:uri,contractVersion:z2.literal(2),remoteService:ref,sourceSelection:FederationSourceSelectionSchema,remoteTenant:ref,consumerRef:ref,grantRef:ref,grantVersion:z2.int().min(1).max(2147483647),notBefore:z2.iso.datetime(),expiresAt:z2.iso.datetime(),state:z2.enum(["ACTIVE","PAUSED","REVOKED"])}).strict();var InboundBindingConfigureSchema=bindingInput.refine(orderedFederationWindow);var bindingView=bindingInput.omit({requestId:true,expectedRevision:true}).extend({revision:z2.int().positive(),installationSource:uri,connectionRef:ref,direction:z2.literal("INBOUND"),effective:z2.enum(["ACTIVE","PAUSED","REVOKED","EXPIRED","BLOCKED"])}).strict();var CurrentInboundBindingSchema=bindingView.extend({eventType:z2.literal(RESOURCE_CHANGE_TYPE),dataSchema:z2.literal(RESOURCE_CHANGE_SCHEMA)}).refine(orderedFederationWindow);var InboundBindingSchema=z2.union([CurrentInboundBindingSchema,bindingView.extend({contractVersion:z2.literal(1).default(1),sourceSelection:HistoricalSourceSelectionSchema.optional(),eventType:ref.optional(),dataSchema:uri.optional()})]);var InboundNoticeSchema=z2.strictObject({resourceRef:z2.string().min(1).max(512),resourceVersion:ref,changeKind:ref,contractVersion:z2.literal(2).optional(),resourceNamespace:ref.optional(),sourceService:ref.optional(),sourceScope:HistoricalSourceScopeSchema.optional(),parentRef:uri.nullable().optional()}).refine(v=>v.contractVersion!==2||v.sourceService!==void 0&&ResourceChangeSchema.safeParse({schemaVersion:1,sourceScope:v.sourceScope,resource:{namespace:v.resourceNamespace,ref:v.resourceRef,version:v.resourceVersion},changeKind:v.changeKind,...v.parentRef!==void 0?{parentRef:v.parentRef}:{}}).success);var InboundInboxViewSchema=FederationScopeSchema.extend({id:uuid,bindingId:uuid,source:uri,eventId:ref,consumerRef:ref,disposition:z2.enum(["RECEIVED","HOLD","APPLIED","REJECTED","UNKNOWN"]),revision:z2.int().positive(),generation:z2.int().nonnegative(),attempts:z2.int().nonnegative(),recoveryCount:z2.int().min(0).max(3),workState:z2.enum(["READY","QUARANTINED","SETTLED"]),reason:ref.nullable(),receivedAt:z2.iso.datetime(),resourceRef:z2.string().min(1).max(512).refine(clean2),resourceVersion:ref}).strict();var signalBase=FederationScopeSchema.extend({inboxId:uuid,consumerRef:ref,source:uri,sourceTenant:ref,effect:z2.literal("REFRESH_HINT"),appliedAt:z2.iso.datetime()}).strict();var InboundSignalSchema=InboundNoticeSchema.safeExtend(signalBase.shape);var InboundReplaySchema=FederationScopeSchema.extend({inboxId:uuid,requestId:ref,expectedGeneration:z2.int().nonnegative(),expectedReceiptRevision:z2.int().positive(),reason:ref,acknowledgeDuplicateRisk:z2.literal(true)}).strict();var InboundReplayResultSchema=FederationScopeSchema.extend({inboxId:uuid,requestId:ref,replayId:uuid,status:z2.literal("QUEUED_FOR_VERIFICATION"),effect:z2.literal("TRANSPORT_ONLY")}).strict();var InboundReplayViewSchema=InboundReplayResultSchema.omit({status:true}).extend({status:z2.enum(["PENDING","REQUEUED","DENIED"]),reasonCode:ref.nullable()}).strict();var InboundQuarantineViewSchema=FederationScopeSchema.extend({id:uuid,bindingId:uuid,deliveryRef:z2.string().min(1).max(2048).refine(clean2),reasonCode:ref,recordedAt:z2.iso.datetime()}).strict();var InboundQuerySchema=FederationScopeSchema.extend({kind:z2.enum(["bindings","inbox","signals","replays","quarantine"]),after:uuid.optional(),limit:z2.int().min(1).max(50).default(20)}).strict();var page=(kind,schema)=>FederationScopeSchema.extend({kind:z2.literal(kind),items:z2.array(schema).max(50),next:uuid.nullable()}).strict();var InboundQueryResultSchema=z2.discriminatedUnion("kind",[page("bindings",InboundBindingSchema),page("inbox",InboundInboxViewSchema),page("signals",InboundSignalSchema),page("replays",InboundReplayViewSchema),page("quarantine",InboundQuarantineViewSchema)]);var InboundReceiptInputSchema=FederationScopeSchema.extend({kind:z2.enum(["EVENT","COMMAND"]),source:uri.optional(),eventId:ref.optional(),consumerRef:ref.optional(),requestId:ref.optional()}).strict().refine(v=>v.kind==="EVENT"?v.source!==void 0&&v.eventId!==void 0&&v.consumerRef!==void 0&&v.requestId===void 0:v.requestId!==void 0&&v.source===void 0&&v.eventId===void 0&&v.consumerRef===void 0);var InboundReceiptSchema=z2.discriminatedUnion("kind",[FederationScopeSchema.extend({kind:z2.literal("EVENT"),source:uri,eventId:ref,consumerRef:ref,result:InboundInboxViewSchema.nullable()}).strict(),FederationScopeSchema.extend({kind:z2.literal("COMMAND"),requestId:ref,result:z2.union([InboundBindingSchema,InboundReplayResultSchema]).nullable()}).strict()]);var InboundCatalogSchema=FederationScopeSchema.extend({defaultReceive:z2.literal(false),configuration:z2.enum(["CONFIGURED","UNCONFIGURED"]),effect:z2.literal("REFRESH_HINT"),bindings:z2.array(CurrentInboundBindingSchema).max(32),events:z2.array(z2.strictObject({sourceService:ref,type:ref,dataSchema:uri})).max(32)}).strict().refine(v=>v.bindings.every(b=>b.tenantId===v.tenantId&&b.productionId===v.productionId&&b.effective==="ACTIVE"));var ref2=z3.string().min(1).max(256);var source=z3.string().min(1).max(2048).refine(v=>URL.canParse(v));var FederationResourceTypeSchema=z3.enum(["nvs.lifecycle-event","nvs.federation.refresh-hint"]);var FederationResultRefSchema=z3.strictObject({sourceSystem:z3.literal("native-video-studio"),resourceType:FederationResourceTypeSchema,resourceId:ref2,revision:z3.string().regex(/^[1-9][0-9]{0,18}$/),digest:z3.string().regex(/^sha256:[a-f0-9]{64}$/),evidenceRef:ref2.optional()});var FederationResultLocatorSchema=FederationScopeSchema.extend({resourceType:FederationResourceTypeSchema,resourceId:z3.uuid().toLowerCase()}).strict();var base=FederationScopeSchema.extend({schemaVersion:z3.literal(1),source,resourceId:z3.uuid(),revision:ref2});var FederationResultValueSchema=z3.discriminatedUnion("resourceType",[base.extend({resourceType:z3.literal("nvs.lifecycle-event"),event:ExternalLifecycleEventSchema}).strict(),base.extend({resourceType:z3.literal("nvs.federation.refresh-hint"),revision:z3.literal("1"),consumerRef:ref2,peerSource:source,peerTenant:ref2,resourceRef:z3.string().min(1).max(512),resourceVersion:ref2,changeKind:ref2,contractVersion:z3.literal(2).optional(),resourceNamespace:ref2.optional(),sourceService:ref2.optional(),sourceScope:HistoricalSourceScopeSchema.optional(),parentRef:z3.string().min(1).max(512).nullable().optional(),appliedAt:z3.iso.datetime()}).strict().refine(v=>{if(v.sourceService===void 0&&(v.sourceScope!==void 0||v.parentRef!==void 0))return false;return InboundNoticeSchema.safeParse({resourceRef:v.resourceRef,resourceVersion:v.resourceVersion,changeKind:v.changeKind,contractVersion:v.contractVersion,resourceNamespace:v.resourceNamespace,...v.sourceService?{sourceService:v.sourceService,sourceScope:v.sourceScope,parentRef:v.parentRef}:{}}).success})]).refine(v=>v.resourceType!=="nvs.lifecycle-event"||v.event.tenantId===v.tenantId&&v.event.productionId===v.productionId&&v.event.eventId===v.resourceId&&String(v.event.basis.productionRevision)===v.revision);var FederationResultReadSchema=FederationScopeSchema.extend({source,reference:FederationResultRefSchema}).strict();var FederationResultReferenceSchema=FederationScopeSchema.extend({source,reference:FederationResultRefSchema,meaning:z3.literal("IMMUTABLE_FACT")}).strict();var FederationResultSnapshotSchema=FederationResultReferenceSchema.extend({value:FederationResultValueSchema}).strict().refine(v=>v.value.source===v.source&&v.value.tenantId===v.tenantId&&v.value.productionId===v.productionId&&v.reference.resourceType===v.value.resourceType&&v.reference.resourceId===v.value.resourceId&&v.reference.revision===v.value.revision);function canonicalFederationJson(value){return boundedJson(value,2048,16,32768)}function canonicalFederationReadJson(value){return boundedJson(value,4096,24,65536)}function canonicalFederationCatalogJson(value){return boundedJson(value,2e4,32,131072)}function boundedJson(value,maxNodes,maxDepth,maxBytes){let nodes=0;let bytes=0;const encoder=new TextEncoder;const reserve=size=>{bytes+=size;if(bytes>maxBytes)throw Error("FEDERATION_JSON_SIZE")};const scalar=text=>{reserve(encoder.encode(text).byteLength);return text};const seen=new Set;const encode=(v,depth)=>{if(++nodes>maxNodes||depth>maxDepth)throw Error("FEDERATION_JSON_BUDGET");if(v===null||typeof v==="boolean")return scalar(String(v));if(typeof v==="number"&&Number.isFinite(v))return scalar(JSON.stringify(v));if(typeof v==="string"){if(v.length>maxBytes)throw Error("FEDERATION_JSON_SIZE");if(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(v))throw Error("FEDERATION_JSON_UNICODE");return scalar(JSON.stringify(v))}if(!v||typeof v!=="object"||seen.has(v))throw Error("FEDERATION_JSON_VALUE");seen.add(v);try{if(Array.isArray(v)){if(v.length>maxNodes-nodes)throw Error("FEDERATION_JSON_BUDGET");if(Reflect.ownKeys(v).length!==v.length+1)throw Error("FEDERATION_JSON_ARRAY");reserve(v.length===0?2:v.length+1);const items=[];for(let index=0;index<v.length;index++){const property=Object.getOwnPropertyDescriptor(v,String(index));if(!property||!("value"in property))throw Error("FEDERATION_JSON_ARRAY");items.push(encode(property.value,depth+1))}return"["+items.join(",")+"]"}if(Object.getPrototypeOf(v)!==Object.prototype&&Object.getPrototypeOf(v)!==null)throw Error("FEDERATION_JSON_OBJECT");if(Object.getOwnPropertySymbols(v).length)throw Error("FEDERATION_JSON_OBJECT");const keys=Object.keys(v);if(keys.length>maxNodes-nodes)throw Error("FEDERATION_JSON_BUDGET");reserve(keys.length===0?2:keys.length*2+1);return"{"+keys.sort().map(key=>{const property=Object.getOwnPropertyDescriptor(v,key);if(!property||!("value"in property))throw Error("FEDERATION_JSON_PROPERTY");return encode(key,depth+1)+":"+encode(property.value,depth+1)}).join(",")+"}"}finally{seen.delete(v)}};return encode(value,0)}export{FederationPeerRefSchema,RESOURCE_CHANGE_TYPE,RESOURCE_CHANGE_SCHEMA,FederationSourceSelectionSchema,InboundBindingConfigureSchema,CurrentInboundBindingSchema,InboundReplaySchema,InboundReplayResultSchema,InboundQuerySchema,InboundQueryResultSchema,InboundReceiptInputSchema,InboundReceiptSchema,InboundCatalogSchema,FederationResultLocatorSchema,FederationResultValueSchema,FederationResultReadSchema,FederationResultReferenceSchema,FederationResultSnapshotSchema,canonicalFederationJson,canonicalFederationReadJson,canonicalFederationCatalogJson};
|