@operla-ai/sdk 0.4.0 → 0.4.2

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.
@@ -2386,6 +2386,171 @@ export type List2Responses = {
2386
2386
  };
2387
2387
  };
2388
2388
  export type List2Response = List2Responses[keyof List2Responses];
2389
+ export type Create2Data = {
2390
+ body?: {
2391
+ /**
2392
+ * The person the conversation is with. Set `resolved: true` when you already have a complete profile to skip identity resolution on later messages.
2393
+ */
2394
+ user?: {
2395
+ /**
2396
+ * Unique identifier of the person in the conversation, in your system.
2397
+ */
2398
+ userId: string;
2399
+ /**
2400
+ * Whether the user is fully identified. Pass `true` to skip user resolution (you have a complete profile); pass `false` (or omit) to have us verify identity from the message. In responses, reflects the current state.
2401
+ */
2402
+ resolved?: boolean;
2403
+ /**
2404
+ * Custom data attached to the user (name, email, account info, etc.).
2405
+ */
2406
+ data?: {
2407
+ [key: string]: unknown;
2408
+ };
2409
+ };
2410
+ /**
2411
+ * Link the conversation to an entity (format: ent_xxxxxxxxxxxx).
2412
+ */
2413
+ entityId?: string;
2414
+ /**
2415
+ * Origin tag for the conversation (e.g. "website", "import"). Stored for analytics.
2416
+ */
2417
+ source?: string;
2418
+ };
2419
+ path?: never;
2420
+ query?: never;
2421
+ url: '/conversations';
2422
+ };
2423
+ export type Create2Errors = {
2424
+ /**
2425
+ * Bad request
2426
+ */
2427
+ 400: {
2428
+ statusCode: number;
2429
+ error: {
2430
+ code: 'MISSING-ORG' | 'VALIDATION' | 'INVALID-JSON';
2431
+ message: string;
2432
+ };
2433
+ };
2434
+ /**
2435
+ * Authentication required
2436
+ */
2437
+ 401: {
2438
+ statusCode: number;
2439
+ error: {
2440
+ code: 'AUTH';
2441
+ message: string;
2442
+ };
2443
+ };
2444
+ /**
2445
+ * Insufficient permissions
2446
+ */
2447
+ 403: {
2448
+ statusCode: number;
2449
+ error: {
2450
+ code: 'FORBIDDEN' | 'SCOPE-FORBIDDEN';
2451
+ message: string;
2452
+ };
2453
+ };
2454
+ };
2455
+ export type Create2Error = Create2Errors[keyof Create2Errors];
2456
+ export type Create2Responses = {
2457
+ /**
2458
+ * Successful response
2459
+ */
2460
+ 200: {
2461
+ /**
2462
+ * Conversation ID (format: conv_xxxxxxxxxxxx).
2463
+ */
2464
+ conversationId: string;
2465
+ /**
2466
+ * Organization the conversation is linked to (id + name); null when not tied to one.
2467
+ */
2468
+ organization: {
2469
+ id: string;
2470
+ name: string;
2471
+ } | null;
2472
+ /**
2473
+ * Current lifecycle status of the conversation.
2474
+ */
2475
+ status: 'pending' | 'processing' | 'awaiting_validation' | 'awaiting_user' | 'resolved' | 'closed' | 'failed' | 'escalated' | 'spam';
2476
+ /**
2477
+ * Short human-readable subject computed from the first messages or the user's identity.
2478
+ */
2479
+ subject: string;
2480
+ /**
2481
+ * The person in the conversation, if identified. Null when no user is known yet.
2482
+ */
2483
+ user: {
2484
+ /**
2485
+ * Unique identifier of the person in the conversation, in your system.
2486
+ */
2487
+ userId: string;
2488
+ /**
2489
+ * Whether the user is fully identified. Pass `true` to skip user resolution (you have a complete profile); pass `false` (or omit) to have us verify identity from the message. In responses, reflects the current state.
2490
+ */
2491
+ resolved?: boolean;
2492
+ /**
2493
+ * Custom data attached to the user (name, email, account info, etc.).
2494
+ */
2495
+ data?: {
2496
+ [key: string]: unknown;
2497
+ };
2498
+ } | null;
2499
+ /**
2500
+ * Entity the conversation is linked to (id + name); null when not tied to one.
2501
+ */
2502
+ entity: {
2503
+ id: string;
2504
+ name: string;
2505
+ } | null;
2506
+ /**
2507
+ * Total number of messages exchanged so far (user + agent).
2508
+ */
2509
+ messageCount: number;
2510
+ /**
2511
+ * ISO timestamp of the last message, or null if no messages yet.
2512
+ */
2513
+ lastMessageAt: string | null;
2514
+ /**
2515
+ * ISO timestamp when the conversation was created.
2516
+ */
2517
+ createdAt: string;
2518
+ /**
2519
+ * ISO timestamp of the last modification (message, status change, etc.).
2520
+ */
2521
+ updatedAt: string;
2522
+ /**
2523
+ * Full message history in chronological order.
2524
+ */
2525
+ thread: Array<{
2526
+ /**
2527
+ * Who emitted the message — the user or your AI agent.
2528
+ */
2529
+ role: 'user' | 'agent';
2530
+ /**
2531
+ * Message body.
2532
+ */
2533
+ content: string;
2534
+ /**
2535
+ * ISO timestamp when the message was recorded.
2536
+ */
2537
+ timestamp: string;
2538
+ /**
2539
+ * Display name of the author (when available).
2540
+ */
2541
+ authorName?: string;
2542
+ }>;
2543
+ /**
2544
+ * Origin tag provided when the conversation was created.
2545
+ */
2546
+ source?: string;
2547
+ /**
2548
+ * Cross-reference ID in your external ticketing system (e.g. Zendesk), when applicable.
2549
+ */
2550
+ externalTicketId?: string;
2551
+ };
2552
+ };
2553
+ export type Create2Response = Create2Responses[keyof Create2Responses];
2389
2554
  export type Get2Data = {
2390
2555
  body?: never;
2391
2556
  path: {
@@ -2951,7 +3116,7 @@ export type List3Responses = {
2951
3116
  };
2952
3117
  };
2953
3118
  export type List3Response = List3Responses[keyof List3Responses];
2954
- export type Create2Data = {
3119
+ export type Create3Data = {
2955
3120
  body?: {
2956
3121
  /**
2957
3122
  * Human-readable name of the entity.
@@ -2968,7 +3133,7 @@ export type Create2Data = {
2968
3133
  query?: never;
2969
3134
  url: '/entities';
2970
3135
  };
2971
- export type Create2Errors = {
3136
+ export type Create3Errors = {
2972
3137
  /**
2973
3138
  * Bad request
2974
3139
  */
@@ -3000,8 +3165,8 @@ export type Create2Errors = {
3000
3165
  };
3001
3166
  };
3002
3167
  };
3003
- export type Create2Error = Create2Errors[keyof Create2Errors];
3004
- export type Create2Responses = {
3168
+ export type Create3Error = Create3Errors[keyof Create3Errors];
3169
+ export type Create3Responses = {
3005
3170
  /**
3006
3171
  * Successful response
3007
3172
  */
@@ -3037,7 +3202,7 @@ export type Create2Responses = {
3037
3202
  };
3038
3203
  };
3039
3204
  };
3040
- export type Create2Response = Create2Responses[keyof Create2Responses];
3205
+ export type Create3Response = Create3Responses[keyof Create3Responses];
3041
3206
  export type Delete2Data = {
3042
3207
  body?: never;
3043
3208
  path: {
@@ -3382,7 +3547,7 @@ export type List4Responses = {
3382
3547
  };
3383
3548
  };
3384
3549
  export type List4Response = List4Responses[keyof List4Responses];
3385
- export type Create3Data = {
3550
+ export type Create4Data = {
3386
3551
  body?: {
3387
3552
  /**
3388
3553
  * Human-readable label. The intent's machine name is derived from it (lower-cased, words joined by `_`).
@@ -3422,7 +3587,7 @@ export type Create3Data = {
3422
3587
  query?: never;
3423
3588
  url: '/intents';
3424
3589
  };
3425
- export type Create3Errors = {
3590
+ export type Create4Errors = {
3426
3591
  /**
3427
3592
  * Bad request
3428
3593
  */
@@ -3454,8 +3619,8 @@ export type Create3Errors = {
3454
3619
  };
3455
3620
  };
3456
3621
  };
3457
- export type Create3Error = Create3Errors[keyof Create3Errors];
3458
- export type Create3Responses = {
3622
+ export type Create4Error = Create4Errors[keyof Create4Errors];
3623
+ export type Create4Responses = {
3459
3624
  /**
3460
3625
  * Successful response
3461
3626
  */
@@ -3520,7 +3685,7 @@ export type Create3Responses = {
3520
3685
  };
3521
3686
  };
3522
3687
  };
3523
- export type Create3Response = Create3Responses[keyof Create3Responses];
3688
+ export type Create4Response = Create4Responses[keyof Create4Responses];
3524
3689
  export type Delete3Data = {
3525
3690
  body?: never;
3526
3691
  path: {
@@ -4009,7 +4174,7 @@ export type List5Responses = {
4009
4174
  };
4010
4175
  };
4011
4176
  export type List5Response = List5Responses[keyof List5Responses];
4012
- export type Create4Data = {
4177
+ export type Create5Data = {
4013
4178
  body?: {
4014
4179
  /**
4015
4180
  * Article title.
@@ -4033,7 +4198,7 @@ export type Create4Data = {
4033
4198
  };
4034
4199
  url: '/kb';
4035
4200
  };
4036
- export type Create4Errors = {
4201
+ export type Create5Errors = {
4037
4202
  /**
4038
4203
  * Bad request
4039
4204
  */
@@ -4065,8 +4230,8 @@ export type Create4Errors = {
4065
4230
  };
4066
4231
  };
4067
4232
  };
4068
- export type Create4Error = Create4Errors[keyof Create4Errors];
4069
- export type Create4Responses = {
4233
+ export type Create5Error = Create5Errors[keyof Create5Errors];
4234
+ export type Create5Responses = {
4070
4235
  /**
4071
4236
  * Successful response
4072
4237
  */
@@ -4156,7 +4321,7 @@ export type Create4Responses = {
4156
4321
  updatedAt: string;
4157
4322
  };
4158
4323
  };
4159
- export type Create4Response = Create4Responses[keyof Create4Responses];
4324
+ export type Create5Response = Create5Responses[keyof Create5Responses];
4160
4325
  export type Delete4Data = {
4161
4326
  body?: never;
4162
4327
  path: {
@@ -4500,6 +4665,319 @@ export type Update4Responses = {
4500
4665
  };
4501
4666
  };
4502
4667
  export type Update4Response = Update4Responses[keyof Update4Responses];
4668
+ export type CreateManyData = {
4669
+ body?: {
4670
+ /**
4671
+ * Articles to create (1–500). Each is published immediately as v1.
4672
+ */
4673
+ articles: Array<{
4674
+ /**
4675
+ * Article title.
4676
+ */
4677
+ title: string;
4678
+ /**
4679
+ * Article body (Markdown).
4680
+ */
4681
+ content: string;
4682
+ /**
4683
+ * Intent IDs this article serves. Empty = always-on within its scope.
4684
+ */
4685
+ intents?: Array<string>;
4686
+ /**
4687
+ * Target a specific entity (under the caller's organization) for this article only.
4688
+ */
4689
+ entityId?: string;
4690
+ }>;
4691
+ };
4692
+ path?: never;
4693
+ query?: never;
4694
+ url: '/kb/bulk';
4695
+ };
4696
+ export type CreateManyErrors = {
4697
+ /**
4698
+ * Bad request
4699
+ */
4700
+ 400: {
4701
+ statusCode: number;
4702
+ error: {
4703
+ code: 'MISSING-ORG' | 'VALIDATION' | 'INVALID-JSON';
4704
+ message: string;
4705
+ };
4706
+ };
4707
+ /**
4708
+ * Authentication required
4709
+ */
4710
+ 401: {
4711
+ statusCode: number;
4712
+ error: {
4713
+ code: 'AUTH';
4714
+ message: string;
4715
+ };
4716
+ };
4717
+ /**
4718
+ * Insufficient permissions
4719
+ */
4720
+ 403: {
4721
+ statusCode: number;
4722
+ error: {
4723
+ code: 'FORBIDDEN' | 'SCOPE-FORBIDDEN';
4724
+ message: string;
4725
+ };
4726
+ };
4727
+ };
4728
+ export type CreateManyError = CreateManyErrors[keyof CreateManyErrors];
4729
+ export type CreateManyResponses = {
4730
+ /**
4731
+ * All articles were created.
4732
+ */
4733
+ 200: {
4734
+ /**
4735
+ * Articles that were created, with their original request index.
4736
+ */
4737
+ created: Array<{
4738
+ /**
4739
+ * Position of this article in the request `articles` array.
4740
+ */
4741
+ index: number;
4742
+ /**
4743
+ * The created article.
4744
+ */
4745
+ article: {
4746
+ /**
4747
+ * KB article ID (format: kb_xxxxxxxxxxxx).
4748
+ */
4749
+ id: string;
4750
+ /**
4751
+ * Cascade level at which this article was created.
4752
+ */
4753
+ scope: {
4754
+ /**
4755
+ * Cascade level this article lives at — `global` (whole tenant), `organization` (per-org), or `entity` (per-entity).
4756
+ */
4757
+ level: 'global' | 'organization' | 'entity';
4758
+ /**
4759
+ * ID of the organization when `level` is `organization` or `entity`.
4760
+ */
4761
+ organizationId?: string;
4762
+ /**
4763
+ * ID of the entity when `level` is `entity`.
4764
+ */
4765
+ entityId?: string;
4766
+ };
4767
+ /**
4768
+ * Intent IDs this article serves. Empty array = always-on within its scope.
4769
+ */
4770
+ intents: Array<string>;
4771
+ /**
4772
+ * Currently published content of the article.
4773
+ */
4774
+ published: {
4775
+ /**
4776
+ * Monotonic version number of this snapshot.
4777
+ */
4778
+ version: number;
4779
+ /**
4780
+ * Article title at this version.
4781
+ */
4782
+ title: string;
4783
+ /**
4784
+ * Article body (Markdown) at this version.
4785
+ */
4786
+ content: string;
4787
+ /**
4788
+ * ISO timestamp of the publication that produced this snapshot.
4789
+ */
4790
+ publishedAt?: string;
4791
+ /**
4792
+ * ISO timestamp of the last draft edit (drafts only).
4793
+ */
4794
+ updatedAt?: string;
4795
+ };
4796
+ /**
4797
+ * Pending draft content, when one exists. Promote it via `publish: true` on update.
4798
+ */
4799
+ draft?: {
4800
+ /**
4801
+ * Monotonic version number of this snapshot.
4802
+ */
4803
+ version: number;
4804
+ /**
4805
+ * Article title at this version.
4806
+ */
4807
+ title: string;
4808
+ /**
4809
+ * Article body (Markdown) at this version.
4810
+ */
4811
+ content: string;
4812
+ /**
4813
+ * ISO timestamp of the publication that produced this snapshot.
4814
+ */
4815
+ publishedAt?: string;
4816
+ /**
4817
+ * ISO timestamp of the last draft edit (drafts only).
4818
+ */
4819
+ updatedAt?: string;
4820
+ };
4821
+ /**
4822
+ * ISO timestamp when the article was created.
4823
+ */
4824
+ createdAt: string;
4825
+ /**
4826
+ * ISO timestamp of the last modification (publish, draft edit, intents change).
4827
+ */
4828
+ updatedAt: string;
4829
+ };
4830
+ }>;
4831
+ summary: {
4832
+ /**
4833
+ * Total number of articles in the request.
4834
+ */
4835
+ total: number;
4836
+ /**
4837
+ * How many were created.
4838
+ */
4839
+ created: number;
4840
+ /**
4841
+ * How many were rejected.
4842
+ */
4843
+ failed: number;
4844
+ };
4845
+ };
4846
+ /**
4847
+ * Partial success — some articles were created, the rest are listed in `failed`.
4848
+ */
4849
+ 207: {
4850
+ /**
4851
+ * Articles that were created, with their original request index.
4852
+ */
4853
+ created: Array<{
4854
+ /**
4855
+ * Position of this article in the request `articles` array.
4856
+ */
4857
+ index: number;
4858
+ /**
4859
+ * The created article.
4860
+ */
4861
+ article: {
4862
+ /**
4863
+ * KB article ID (format: kb_xxxxxxxxxxxx).
4864
+ */
4865
+ id: string;
4866
+ /**
4867
+ * Cascade level at which this article was created.
4868
+ */
4869
+ scope: {
4870
+ /**
4871
+ * Cascade level this article lives at — `global` (whole tenant), `organization` (per-org), or `entity` (per-entity).
4872
+ */
4873
+ level: 'global' | 'organization' | 'entity';
4874
+ /**
4875
+ * ID of the organization when `level` is `organization` or `entity`.
4876
+ */
4877
+ organizationId?: string;
4878
+ /**
4879
+ * ID of the entity when `level` is `entity`.
4880
+ */
4881
+ entityId?: string;
4882
+ };
4883
+ /**
4884
+ * Intent IDs this article serves. Empty array = always-on within its scope.
4885
+ */
4886
+ intents: Array<string>;
4887
+ /**
4888
+ * Currently published content of the article.
4889
+ */
4890
+ published: {
4891
+ /**
4892
+ * Monotonic version number of this snapshot.
4893
+ */
4894
+ version: number;
4895
+ /**
4896
+ * Article title at this version.
4897
+ */
4898
+ title: string;
4899
+ /**
4900
+ * Article body (Markdown) at this version.
4901
+ */
4902
+ content: string;
4903
+ /**
4904
+ * ISO timestamp of the publication that produced this snapshot.
4905
+ */
4906
+ publishedAt?: string;
4907
+ /**
4908
+ * ISO timestamp of the last draft edit (drafts only).
4909
+ */
4910
+ updatedAt?: string;
4911
+ };
4912
+ /**
4913
+ * Pending draft content, when one exists. Promote it via `publish: true` on update.
4914
+ */
4915
+ draft?: {
4916
+ /**
4917
+ * Monotonic version number of this snapshot.
4918
+ */
4919
+ version: number;
4920
+ /**
4921
+ * Article title at this version.
4922
+ */
4923
+ title: string;
4924
+ /**
4925
+ * Article body (Markdown) at this version.
4926
+ */
4927
+ content: string;
4928
+ /**
4929
+ * ISO timestamp of the publication that produced this snapshot.
4930
+ */
4931
+ publishedAt?: string;
4932
+ /**
4933
+ * ISO timestamp of the last draft edit (drafts only).
4934
+ */
4935
+ updatedAt?: string;
4936
+ };
4937
+ /**
4938
+ * ISO timestamp when the article was created.
4939
+ */
4940
+ createdAt: string;
4941
+ /**
4942
+ * ISO timestamp of the last modification (publish, draft edit, intents change).
4943
+ */
4944
+ updatedAt: string;
4945
+ };
4946
+ }>;
4947
+ /**
4948
+ * Articles that were rejected, with the reason — the rest were still created.
4949
+ */
4950
+ failed: Array<{
4951
+ /**
4952
+ * Position of the rejected article in the request `articles` array.
4953
+ */
4954
+ index: number;
4955
+ /**
4956
+ * Machine-readable failure code (e.g. `VALIDATION`).
4957
+ */
4958
+ code: string;
4959
+ /**
4960
+ * Human-readable reason the article was rejected.
4961
+ */
4962
+ error: string;
4963
+ }>;
4964
+ summary: {
4965
+ /**
4966
+ * Total number of articles in the request.
4967
+ */
4968
+ total: number;
4969
+ /**
4970
+ * How many were created.
4971
+ */
4972
+ created: number;
4973
+ /**
4974
+ * How many were rejected.
4975
+ */
4976
+ failed: number;
4977
+ };
4978
+ };
4979
+ };
4980
+ export type CreateManyResponse = CreateManyResponses[keyof CreateManyResponses];
4503
4981
  export type Publish2Data = {
4504
4982
  body?: never;
4505
4983
  path: {
@@ -4865,7 +5343,7 @@ export type List6Responses = {
4865
5343
  };
4866
5344
  };
4867
5345
  export type List6Response = List6Responses[keyof List6Responses];
4868
- export type Create5Data = {
5346
+ export type Create6Data = {
4869
5347
  body?: {
4870
5348
  /**
4871
5349
  * Human-readable name of the organization (must be unique).
@@ -4886,7 +5364,7 @@ export type Create5Data = {
4886
5364
  query?: never;
4887
5365
  url: '/organizations';
4888
5366
  };
4889
- export type Create5Errors = {
5367
+ export type Create6Errors = {
4890
5368
  /**
4891
5369
  * Bad request
4892
5370
  */
@@ -4918,8 +5396,8 @@ export type Create5Errors = {
4918
5396
  };
4919
5397
  };
4920
5398
  };
4921
- export type Create5Error = Create5Errors[keyof Create5Errors];
4922
- export type Create5Responses = {
5399
+ export type Create6Error = Create6Errors[keyof Create6Errors];
5400
+ export type Create6Responses = {
4923
5401
  /**
4924
5402
  * Successful response
4925
5403
  */
@@ -4957,7 +5435,7 @@ export type Create5Responses = {
4957
5435
  apiKey?: string;
4958
5436
  };
4959
5437
  };
4960
- export type Create5Response = Create5Responses[keyof Create5Responses];
5438
+ export type Create6Response = Create6Responses[keyof Create6Responses];
4961
5439
  export type Delete5Data = {
4962
5440
  body?: never;
4963
5441
  path: {