@elevasis/sdk 1.46.0 → 1.48.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.
package/dist/index.d.ts CHANGED
@@ -2612,6 +2612,7 @@ type Database = {
2612
2612
  activities: {
2613
2613
  Row: {
2614
2614
  activity_type: string;
2615
+ actor_api_key_id: string | null;
2615
2616
  actor_id: string | null;
2616
2617
  actor_type: string | null;
2617
2618
  created_at: string;
@@ -2628,6 +2629,7 @@ type Database = {
2628
2629
  };
2629
2630
  Insert: {
2630
2631
  activity_type: string;
2632
+ actor_api_key_id?: string | null;
2631
2633
  actor_id?: string | null;
2632
2634
  actor_type?: string | null;
2633
2635
  created_at?: string;
@@ -2644,6 +2646,7 @@ type Database = {
2644
2646
  };
2645
2647
  Update: {
2646
2648
  activity_type?: string;
2649
+ actor_api_key_id?: string | null;
2647
2650
  actor_id?: string | null;
2648
2651
  actor_type?: string | null;
2649
2652
  created_at?: string;
@@ -2659,6 +2662,13 @@ type Database = {
2659
2662
  title?: string;
2660
2663
  };
2661
2664
  Relationships: [
2665
+ {
2666
+ foreignKeyName: "activities_actor_api_key_id_fkey";
2667
+ columns: ["actor_api_key_id"];
2668
+ isOneToOne: false;
2669
+ referencedRelation: "api_keys";
2670
+ referencedColumns: ["id"];
2671
+ },
2662
2672
  {
2663
2673
  foreignKeyName: "activities_actor_id_fkey";
2664
2674
  columns: ["actor_id"];
@@ -2746,6 +2756,7 @@ type Database = {
2746
2756
  api_keys: {
2747
2757
  Row: {
2748
2758
  created_at: string | null;
2759
+ created_by: string | null;
2749
2760
  id: string;
2750
2761
  key_hash: string;
2751
2762
  last_used_at: string | null;
@@ -2754,6 +2765,7 @@ type Database = {
2754
2765
  };
2755
2766
  Insert: {
2756
2767
  created_at?: string | null;
2768
+ created_by?: string | null;
2757
2769
  id?: string;
2758
2770
  key_hash: string;
2759
2771
  last_used_at?: string | null;
@@ -2762,6 +2774,7 @@ type Database = {
2762
2774
  };
2763
2775
  Update: {
2764
2776
  created_at?: string | null;
2777
+ created_by?: string | null;
2765
2778
  id?: string;
2766
2779
  key_hash?: string;
2767
2780
  last_used_at?: string | null;
@@ -2769,6 +2782,13 @@ type Database = {
2769
2782
  organization_id?: string;
2770
2783
  };
2771
2784
  Relationships: [
2785
+ {
2786
+ foreignKeyName: "api_keys_created_by_fkey";
2787
+ columns: ["created_by"];
2788
+ isOneToOne: false;
2789
+ referencedRelation: "users";
2790
+ referencedColumns: ["id"];
2791
+ },
2772
2792
  {
2773
2793
  foreignKeyName: "api_keys_organization_id_fkey";
2774
2794
  columns: ["organization_id"];
@@ -3096,6 +3116,7 @@ type Database = {
3096
3116
  organization_id: string;
3097
3117
  payload: Json;
3098
3118
  source_execution_id: string | null;
3119
+ status: string;
3099
3120
  step_key: string | null;
3100
3121
  };
3101
3122
  Insert: {
@@ -3107,6 +3128,7 @@ type Database = {
3107
3128
  organization_id: string;
3108
3129
  payload?: Json;
3109
3130
  source_execution_id?: string | null;
3131
+ status: string;
3110
3132
  step_key?: string | null;
3111
3133
  };
3112
3134
  Update: {
@@ -3118,6 +3140,7 @@ type Database = {
3118
3140
  organization_id?: string;
3119
3141
  payload?: Json;
3120
3142
  source_execution_id?: string | null;
3143
+ status?: string;
3121
3144
  step_key?: string | null;
3122
3145
  };
3123
3146
  Relationships: [
@@ -3269,6 +3292,7 @@ type Database = {
3269
3292
  kind: string;
3270
3293
  metadata: Json;
3271
3294
  organization_id: string;
3295
+ payload: Json;
3272
3296
  processing_state: Json;
3273
3297
  storage_path: string | null;
3274
3298
  title: string;
@@ -3282,6 +3306,7 @@ type Database = {
3282
3306
  kind: string;
3283
3307
  metadata?: Json;
3284
3308
  organization_id: string;
3309
+ payload?: Json;
3285
3310
  processing_state?: Json;
3286
3311
  storage_path?: string | null;
3287
3312
  title: string;
@@ -3295,6 +3320,7 @@ type Database = {
3295
3320
  kind?: string;
3296
3321
  metadata?: Json;
3297
3322
  organization_id?: string;
3323
+ payload?: Json;
3298
3324
  processing_state?: Json;
3299
3325
  storage_path?: string | null;
3300
3326
  title?: string;
@@ -7250,7 +7276,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
7250
7276
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7251
7277
  route: z.ZodOptional<z.ZodString>;
7252
7278
  }, z.core.$loose>>>>;
7253
- }, z.core.$strip>>;
7279
+ }, z.core.$strict>>;
7254
7280
  type OntologyObjectType = z.infer<typeof OntologyObjectTypeSchema>;
7255
7281
  type OntologyLinkType = z.infer<typeof OntologyLinkTypeSchema>;
7256
7282
  type OntologyActionType = z.infer<typeof OntologyActionTypeSchema>;
@@ -8622,7 +8648,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
8622
8648
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
8623
8649
  route: z.ZodOptional<z.ZodString>;
8624
8650
  }, z.core.$loose>>>>;
8625
- }, z.core.$strip>>>;
8651
+ }, z.core.$strict>>>;
8626
8652
  resources: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
8627
8653
  id: z.ZodString;
8628
8654
  order: z.ZodDefault<z.ZodNumber>;
@@ -11154,6 +11180,20 @@ declare const ProjectSchemas: {
11154
11180
  }, z.core.$strip>;
11155
11181
  };
11156
11182
 
11183
+ /**
11184
+ * `'running'` is the only in-flight value; every other member is terminal.
11185
+ * Added 2026-08-14 (the step-state model): a producer writes `'running'`
11186
+ * when it starts a step and patches the same row to a terminal status when
11187
+ * the step finishes (`updateAttempt`) — see `CreateContentItemAttemptRequestSchema`
11188
+ * / `UpdateContentItemAttemptRequestSchema` below.
11189
+ */
11190
+ declare const ContentStepStatusSchema: z.ZodEnum<{
11191
+ error: "error";
11192
+ success: "success";
11193
+ running: "running";
11194
+ no_result: "no_result";
11195
+ skipped: "skipped";
11196
+ }>;
11157
11197
  /** D18: `pipeline_id` is an OM ontology id (free text), not a UUID. */
11158
11198
  declare const ContentPipelineIdSchema: z.ZodString;
11159
11199
  /** `content:catalog/status` entries. Free text, model-owned. */
@@ -11188,9 +11228,13 @@ declare const ContentItemResponseSchema: z.ZodObject<{
11188
11228
  status: z.ZodEnum<{
11189
11229
  error: "error";
11190
11230
  success: "success";
11231
+ running: "running";
11191
11232
  no_result: "no_result";
11192
11233
  skipped: "skipped";
11193
11234
  }>;
11235
+ attemptId: z.ZodString;
11236
+ executionId: z.ZodNullable<z.ZodString>;
11237
+ attemptedAt: z.ZodString;
11194
11238
  data: z.ZodOptional<z.ZodUnknown>;
11195
11239
  }, z.core.$loose>>;
11196
11240
  reviewedAt: z.ZodNullable<z.ZodString>;
@@ -11218,9 +11262,13 @@ declare const ContentItemListResponseSchema: z.ZodObject<{
11218
11262
  status: z.ZodEnum<{
11219
11263
  error: "error";
11220
11264
  success: "success";
11265
+ running: "running";
11221
11266
  no_result: "no_result";
11222
11267
  skipped: "skipped";
11223
11268
  }>;
11269
+ attemptId: z.ZodString;
11270
+ executionId: z.ZodNullable<z.ZodString>;
11271
+ attemptedAt: z.ZodString;
11224
11272
  data: z.ZodOptional<z.ZodUnknown>;
11225
11273
  }, z.core.$loose>>;
11226
11274
  reviewedAt: z.ZodNullable<z.ZodString>;
@@ -11242,6 +11290,13 @@ declare const ContentItemAttemptResponseSchema: z.ZodObject<{
11242
11290
  contentItemId: z.ZodString;
11243
11291
  attemptNumber: z.ZodNumber;
11244
11292
  stepKey: z.ZodNullable<z.ZodString>;
11293
+ status: z.ZodEnum<{
11294
+ error: "error";
11295
+ success: "success";
11296
+ running: "running";
11297
+ no_result: "no_result";
11298
+ skipped: "skipped";
11299
+ }>;
11245
11300
  payload: z.ZodUnknown;
11246
11301
  sourceExecutionId: z.ZodNullable<z.ZodString>;
11247
11302
  createdBy: z.ZodNullable<z.ZodString>;
@@ -11254,12 +11309,45 @@ declare const ContentItemAttemptListResponseSchema: z.ZodObject<{
11254
11309
  contentItemId: z.ZodString;
11255
11310
  attemptNumber: z.ZodNumber;
11256
11311
  stepKey: z.ZodNullable<z.ZodString>;
11312
+ status: z.ZodEnum<{
11313
+ error: "error";
11314
+ success: "success";
11315
+ running: "running";
11316
+ no_result: "no_result";
11317
+ skipped: "skipped";
11318
+ }>;
11257
11319
  payload: z.ZodUnknown;
11258
11320
  sourceExecutionId: z.ZodNullable<z.ZodString>;
11259
11321
  createdBy: z.ZodNullable<z.ZodString>;
11260
11322
  createdAt: z.ZodString;
11261
11323
  }, z.core.$strip>>;
11262
11324
  }, z.core.$strip>;
11325
+ declare const ContentSourceAssetResponseSchema: z.ZodObject<{
11326
+ id: z.ZodString;
11327
+ organizationId: z.ZodString;
11328
+ kind: z.ZodString;
11329
+ title: z.ZodString;
11330
+ externalUrl: z.ZodNullable<z.ZodString>;
11331
+ storagePath: z.ZodNullable<z.ZodString>;
11332
+ durationSeconds: z.ZodNullable<z.ZodNumber>;
11333
+ metadata: z.ZodUnknown;
11334
+ payload: z.ZodUnknown;
11335
+ processingState: z.ZodRecord<z.ZodString, z.ZodObject<{
11336
+ status: z.ZodEnum<{
11337
+ error: "error";
11338
+ success: "success";
11339
+ running: "running";
11340
+ no_result: "no_result";
11341
+ skipped: "skipped";
11342
+ }>;
11343
+ attemptId: z.ZodString;
11344
+ executionId: z.ZodNullable<z.ZodString>;
11345
+ attemptedAt: z.ZodString;
11346
+ data: z.ZodOptional<z.ZodUnknown>;
11347
+ }, z.core.$loose>>;
11348
+ createdAt: z.ZodString;
11349
+ updatedAt: z.ZodString;
11350
+ }, z.core.$strip>;
11263
11351
  declare const ContentDistributionResponseSchema: z.ZodObject<{
11264
11352
  id: z.ZodString;
11265
11353
  organizationId: z.ZodString;
@@ -11275,9 +11363,13 @@ declare const ContentDistributionResponseSchema: z.ZodObject<{
11275
11363
  status: z.ZodEnum<{
11276
11364
  error: "error";
11277
11365
  success: "success";
11366
+ running: "running";
11278
11367
  no_result: "no_result";
11279
11368
  skipped: "skipped";
11280
11369
  }>;
11370
+ attemptId: z.ZodString;
11371
+ executionId: z.ZodNullable<z.ZodString>;
11372
+ attemptedAt: z.ZodString;
11281
11373
  data: z.ZodOptional<z.ZodUnknown>;
11282
11374
  }, z.core.$loose>>;
11283
11375
  publishMethod: z.ZodNullable<z.ZodString>;
@@ -11289,6 +11381,7 @@ declare const ContentDistributionResponseSchema: z.ZodObject<{
11289
11381
  createdAt: z.ZodString;
11290
11382
  updatedAt: z.ZodString;
11291
11383
  }, z.core.$strip>;
11384
+ type ContentStepStatus = z.infer<typeof ContentStepStatusSchema>;
11292
11385
  type ContentPipelineId = z.infer<typeof ContentPipelineIdSchema>;
11293
11386
  type ContentItemStatus = z.infer<typeof ContentItemStatusSchema>;
11294
11387
  type ContentPillar = z.infer<typeof ContentPillarSchema>;
@@ -11300,6 +11393,7 @@ type ContentItemResponse = z.infer<typeof ContentItemResponseSchema>;
11300
11393
  type ContentItemListResponse = z.infer<typeof ContentItemListResponseSchema>;
11301
11394
  type ContentItemAttemptResponse = z.infer<typeof ContentItemAttemptResponseSchema>;
11302
11395
  type ContentItemAttemptListResponse = z.infer<typeof ContentItemAttemptListResponseSchema>;
11396
+ type ContentSourceAssetResponse = z.infer<typeof ContentSourceAssetResponseSchema>;
11303
11397
  type ContentDistributionResponse = z.infer<typeof ContentDistributionResponseSchema>;
11304
11398
 
11305
11399
  /**
@@ -12339,6 +12433,13 @@ type ContentToolMap = {
12339
12433
  /** Which step this attempt implements. Stored as-is; NULL when omitted. */
12340
12434
  stepKey?: string | null;
12341
12435
  sourceExecutionId?: string | null;
12436
+ /**
12437
+ * The status the row is created with. Optional so a producer starting a
12438
+ * step can write `'running'` before doing the work -- the "write-at-start"
12439
+ * half of write-at-start/patch-at-end. Omitted, the column's own default
12440
+ * applies, which is why a producer that means `'running'` must say so.
12441
+ */
12442
+ status?: ContentStepStatus;
12342
12443
  };
12343
12444
  result: ContentItemAttemptResponse;
12344
12445
  };
@@ -12349,6 +12450,69 @@ type ContentToolMap = {
12349
12450
  };
12350
12451
  result: ContentItemAttemptListResponse;
12351
12452
  };
12453
+ /**
12454
+ * Patch an existing attempt to its terminal status -- the "patch-at-end"
12455
+ * half of write-at-start/patch-at-end (see `ContentStepStatus`'s
12456
+ * `'running'` value). `attemptNumber`, `stepKey`, and `sourceExecutionId`
12457
+ * are immutable once written; only `status` and `payload` change here.
12458
+ */
12459
+ updateAttempt: {
12460
+ params: {
12461
+ attemptId: string;
12462
+ status?: ContentStepStatus;
12463
+ payload?: ContentPayloadEnvelope;
12464
+ };
12465
+ result: ContentItemAttemptResponse;
12466
+ };
12467
+ /**
12468
+ * Insert a new `content_source_assets` row. `payload` is an open envelope
12469
+ * (D5, content-source-asset-write-path.mdx) -- per-`kind` field membership
12470
+ * is declared in the OM catalog, not enforced by this transport type.
12471
+ */
12472
+ createSourceAsset: {
12473
+ params: {
12474
+ kind: string;
12475
+ title: string;
12476
+ externalUrl?: string | null;
12477
+ storagePath?: string | null;
12478
+ durationSeconds?: number | null;
12479
+ metadata?: Record<string, unknown>;
12480
+ payload?: ContentPayloadEnvelope;
12481
+ };
12482
+ result: ContentSourceAssetResponse;
12483
+ };
12484
+ /** Fetch a single source asset by id, org-scoped. */
12485
+ getSourceAsset: {
12486
+ params: {
12487
+ sourceAssetId: string;
12488
+ };
12489
+ result: ContentSourceAssetResponse | null;
12490
+ };
12491
+ /** Query source assets -- e.g. a producer picking material for the next item. */
12492
+ listSourceAssets: {
12493
+ params: {
12494
+ kind?: string;
12495
+ limit?: number;
12496
+ offset?: number;
12497
+ };
12498
+ result: {
12499
+ data: ContentSourceAssetResponse[];
12500
+ };
12501
+ };
12502
+ /** Update a source asset's mutable fields. */
12503
+ updateSourceAsset: {
12504
+ params: {
12505
+ sourceAssetId: string;
12506
+ kind?: string;
12507
+ title?: string;
12508
+ externalUrl?: string | null;
12509
+ storagePath?: string | null;
12510
+ durationSeconds?: number | null;
12511
+ metadata?: Record<string, unknown>;
12512
+ payload?: ContentPayloadEnvelope;
12513
+ };
12514
+ result: ContentSourceAssetResponse;
12515
+ };
12352
12516
  /** Insert a `content_distributions` row for one platform/format target. */
12353
12517
  createDistribution: {
12354
12518
  params: {
package/dist/index.js CHANGED
@@ -114,7 +114,7 @@ var OntologyScopeSchema = z.object({
114
114
  sharedProperties: z.record(OntologyIdSchema, OntologySharedPropertySchema).default({}).optional(),
115
115
  groups: z.record(OntologyIdSchema, OntologyGroupSchema).default({}).optional(),
116
116
  endpoints: z.record(OntologyIdSchema, OntologyEndpointTypeSchema).default({}).optional()
117
- }).default({});
117
+ }).strict().default({});
118
118
  var SCOPE_KIND = {
119
119
  objectTypes: "object",
120
120
  linkTypes: "link",
@@ -612,29 +612,45 @@ var SystemUiSchema = z.object({
612
612
  path: PathSchema,
613
613
  surfaces: ReferenceIdsSchema,
614
614
  icon: IconNameSchema.optional()
615
- });
615
+ }).strict();
616
616
  var SystemInterfaceKeySchema = ModelIdSchema;
617
617
  var SystemInterfaceLifecycleSchema = z.enum(["draft", "active", "disabled", "deprecated", "archived"]).meta({ label: "System interface lifecycle", color: "teal" });
618
618
  var SYSTEM_INTERFACE_PROFILES = [
619
619
  {
620
620
  systemPath: "sales.lead-gen",
621
621
  interfaceKey: "api",
622
- readinessProfile: "sales.lead-gen.api"
622
+ readinessProfile: "sales.lead-gen.api",
623
+ validation: "built-in"
623
624
  },
624
625
  {
625
626
  systemPath: "sales.crm",
626
627
  interfaceKey: "api",
627
- readinessProfile: "sales.crm.api"
628
+ readinessProfile: "sales.crm.api",
629
+ validation: "built-in"
628
630
  },
629
631
  {
630
632
  systemPath: "sales.lead-gen",
631
633
  interfaceKey: "crm-handoff",
632
- readinessProfile: "sales.lead-gen.crm-handoff"
634
+ readinessProfile: "sales.lead-gen.crm-handoff",
635
+ validation: "built-in"
636
+ },
637
+ {
638
+ // Gated by `CONTENT_API_INTERFACE` in `apps/api/src/business/content/organization-model.ts`,
639
+ // which every `/api/content/*` and `/api/external/content/*` route asserts. Contract-validated
640
+ // rather than built-in because the required step catalog is per-adopter: Elevasis declares
641
+ // `content:catalog/long-form-to-shorts-steps`, a tenant declares its own.
642
+ systemPath: "content",
643
+ interfaceKey: "api",
644
+ readinessProfile: "content.api",
645
+ validation: "contract"
633
646
  }
634
647
  ];
635
- var SYSTEM_INTERFACE_READINESS_PROFILES = SYSTEM_INTERFACE_PROFILES.map(
648
+ SYSTEM_INTERFACE_PROFILES.map(
636
649
  (profile) => profile.readinessProfile
637
650
  );
651
+ var BUILT_IN_VALIDATED_PROFILE_IDS = SYSTEM_INTERFACE_PROFILES.filter(
652
+ (profile) => profile.validation === "built-in"
653
+ ).map((profile) => profile.readinessProfile);
638
654
  var SystemInterfaceReadinessProfileSchema = z.string().trim().min(1);
639
655
  var SystemInterfaceResourceScopeSchema = z.array(ModelIdSchema).default([]);
640
656
  var SystemApiInterfaceReadinessContractSchema = z.object({
@@ -673,7 +689,7 @@ var SystemApiInterfaceSchema = z.object({
673
689
  }).strict();
674
690
  var _customProfileIds = /* @__PURE__ */ new Set();
675
691
  function isReservedPlatformProfileId(profileId) {
676
- return SYSTEM_INTERFACE_READINESS_PROFILES.includes(profileId);
692
+ return BUILT_IN_VALIDATED_PROFILE_IDS.includes(profileId);
677
693
  }
678
694
  function lookupReadinessProfile(profileId) {
679
695
  if (isReservedPlatformProfileId(profileId) || getBuiltInReadinessProfile(profileId) !== void 0) {
@@ -1622,7 +1622,7 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
1622
1622
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
1623
1623
  route: z.ZodOptional<z.ZodString>;
1624
1624
  }, z.core.$loose>>>>;
1625
- }, z.core.$strip>>;
1625
+ }, z.core.$strict>>;
1626
1626
  type OntologyScope = z.infer<typeof OntologyScopeSchema>;
1627
1627
 
1628
1628
  declare const SystemApiInterfaceSchema: z.ZodObject<{
@@ -2269,7 +2269,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
2269
2269
  aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
2270
2270
  route: z.ZodOptional<z.ZodString>;
2271
2271
  }, z.core.$loose>>>>;
2272
- }, z.core.$strip>>>;
2272
+ }, z.core.$strict>>>;
2273
2273
  resources: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2274
2274
  id: z.ZodString;
2275
2275
  order: z.ZodDefault<z.ZodNumber>;