@knowledge-stack/ksapi 1.162.0 → 2.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.
Files changed (153) hide show
  1. package/.openapi-generator/FILES +20 -2
  2. package/README.md +13 -3
  3. package/dist/apis/BillingApi.d.ts +70 -0
  4. package/dist/apis/BillingApi.js +120 -0
  5. package/dist/apis/DocumentVersionsApi.d.ts +8 -8
  6. package/dist/apis/DocumentVersionsApi.js +4 -4
  7. package/dist/apis/DocumentsApi.d.ts +4 -4
  8. package/dist/apis/DocumentsApi.js +2 -2
  9. package/dist/apis/SubscriptionsApi.d.ts +17 -20
  10. package/dist/apis/SubscriptionsApi.js +6 -9
  11. package/dist/apis/TenantsApi.d.ts +4 -4
  12. package/dist/apis/TenantsApi.js +2 -2
  13. package/dist/apis/TrashApi.d.ts +39 -1
  14. package/dist/apis/TrashApi.js +48 -0
  15. package/dist/apis/WorkflowRunsApi.d.ts +4 -4
  16. package/dist/apis/WorkflowRunsApi.js +2 -2
  17. package/dist/apis/index.d.ts +1 -0
  18. package/dist/apis/index.js +1 -0
  19. package/dist/esm/apis/BillingApi.d.ts +70 -0
  20. package/dist/esm/apis/BillingApi.js +83 -0
  21. package/dist/esm/apis/DocumentVersionsApi.d.ts +8 -8
  22. package/dist/esm/apis/DocumentVersionsApi.js +4 -4
  23. package/dist/esm/apis/DocumentsApi.d.ts +4 -4
  24. package/dist/esm/apis/DocumentsApi.js +2 -2
  25. package/dist/esm/apis/SubscriptionsApi.d.ts +17 -20
  26. package/dist/esm/apis/SubscriptionsApi.js +7 -10
  27. package/dist/esm/apis/TenantsApi.d.ts +4 -4
  28. package/dist/esm/apis/TenantsApi.js +2 -2
  29. package/dist/esm/apis/TrashApi.d.ts +39 -1
  30. package/dist/esm/apis/TrashApi.js +49 -1
  31. package/dist/esm/apis/WorkflowRunsApi.d.ts +4 -4
  32. package/dist/esm/apis/WorkflowRunsApi.js +2 -2
  33. package/dist/esm/apis/index.d.ts +1 -0
  34. package/dist/esm/apis/index.js +1 -0
  35. package/dist/esm/models/BillingInterval.d.ts +25 -0
  36. package/dist/esm/models/BillingInterval.js +43 -0
  37. package/dist/esm/models/BillingPaymentResponse.d.ts +100 -0
  38. package/dist/esm/models/BillingPaymentResponse.js +75 -0
  39. package/dist/esm/models/BillingSystem.d.ts +30 -0
  40. package/dist/esm/models/BillingSystem.js +48 -0
  41. package/dist/esm/models/ChangeSubscriptionRequest.d.ts +34 -0
  42. package/dist/esm/models/ChangeSubscriptionRequest.js +10 -0
  43. package/dist/esm/models/CheckoutAction.d.ts +27 -0
  44. package/dist/esm/models/CheckoutAction.js +45 -0
  45. package/dist/esm/models/CheckoutResponse.d.ts +76 -0
  46. package/dist/esm/models/{SubmitSubscriptionResponse.js → CheckoutResponse.js} +20 -20
  47. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +19 -0
  48. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +10 -0
  49. package/dist/esm/models/IdpConfig.d.ts +6 -0
  50. package/dist/esm/models/IdpConfig.js +10 -1
  51. package/dist/esm/models/PaginatedResponseBillingPaymentResponse.d.ts +66 -0
  52. package/dist/esm/models/PaginatedResponseBillingPaymentResponse.js +70 -0
  53. package/dist/esm/models/ScheduleCadence.d.ts +32 -0
  54. package/dist/esm/models/ScheduleCadence.js +50 -0
  55. package/dist/esm/models/SubscriptionPlanResponse.d.ts +24 -0
  56. package/dist/esm/models/SubscriptionPlanResponse.js +8 -0
  57. package/dist/esm/models/{SubmitSubscriptionResponse.d.ts → TenantSubscriptionResponse.d.ts} +49 -38
  58. package/dist/esm/models/TenantSubscriptionResponse.js +67 -0
  59. package/dist/esm/models/TrashItemDetailResponse.d.ts +110 -0
  60. package/dist/esm/models/TrashItemDetailResponse.js +81 -0
  61. package/dist/esm/models/TrashItemResponse.d.ts +7 -0
  62. package/dist/esm/models/TrashItemResponse.js +3 -0
  63. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +19 -0
  64. package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +10 -0
  65. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +19 -0
  66. package/dist/esm/models/WorkflowDefinitionResponse.js +7 -0
  67. package/dist/esm/models/index.d.ts +9 -1
  68. package/dist/esm/models/index.js +9 -1
  69. package/dist/models/BillingInterval.d.ts +25 -0
  70. package/dist/models/BillingInterval.js +51 -0
  71. package/dist/models/BillingPaymentResponse.d.ts +100 -0
  72. package/dist/models/BillingPaymentResponse.js +83 -0
  73. package/dist/models/BillingSystem.d.ts +30 -0
  74. package/dist/models/BillingSystem.js +56 -0
  75. package/dist/models/ChangeSubscriptionRequest.d.ts +34 -0
  76. package/dist/models/ChangeSubscriptionRequest.js +10 -0
  77. package/dist/models/CheckoutAction.d.ts +27 -0
  78. package/dist/models/CheckoutAction.js +53 -0
  79. package/dist/models/CheckoutResponse.d.ts +76 -0
  80. package/dist/models/{SubmitSubscriptionResponse.js → CheckoutResponse.js} +26 -26
  81. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +19 -0
  82. package/dist/models/CreateWorkflowDefinitionRequest.js +10 -0
  83. package/dist/models/IdpConfig.d.ts +6 -0
  84. package/dist/models/IdpConfig.js +10 -1
  85. package/dist/models/PaginatedResponseBillingPaymentResponse.d.ts +66 -0
  86. package/dist/models/PaginatedResponseBillingPaymentResponse.js +78 -0
  87. package/dist/models/ScheduleCadence.d.ts +32 -0
  88. package/dist/models/ScheduleCadence.js +58 -0
  89. package/dist/models/SubscriptionPlanResponse.d.ts +24 -0
  90. package/dist/models/SubscriptionPlanResponse.js +8 -0
  91. package/dist/models/{SubmitSubscriptionResponse.d.ts → TenantSubscriptionResponse.d.ts} +49 -38
  92. package/dist/models/TenantSubscriptionResponse.js +75 -0
  93. package/dist/models/TrashItemDetailResponse.d.ts +110 -0
  94. package/dist/models/TrashItemDetailResponse.js +89 -0
  95. package/dist/models/TrashItemResponse.d.ts +7 -0
  96. package/dist/models/TrashItemResponse.js +3 -0
  97. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +19 -0
  98. package/dist/models/UpdateWorkflowDefinitionRequest.js +10 -0
  99. package/dist/models/WorkflowDefinitionResponse.d.ts +19 -0
  100. package/dist/models/WorkflowDefinitionResponse.js +7 -0
  101. package/dist/models/index.d.ts +9 -1
  102. package/dist/models/index.js +9 -1
  103. package/docs/BillingApi.md +90 -0
  104. package/docs/BillingInterval.md +33 -0
  105. package/docs/BillingPaymentResponse.md +51 -0
  106. package/docs/BillingSystem.md +33 -0
  107. package/docs/ChangeSubscriptionRequest.md +9 -1
  108. package/docs/CheckoutAction.md +33 -0
  109. package/docs/CheckoutResponse.md +41 -0
  110. package/docs/CreateWorkflowDefinitionRequest.md +6 -0
  111. package/docs/DocumentVersionsApi.md +2 -2
  112. package/docs/DocumentsApi.md +1 -1
  113. package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +6 -0
  114. package/docs/IdpConfig.md +2 -0
  115. package/docs/PaginatedResponseBillingPaymentResponse.md +40 -0
  116. package/docs/ScheduleCadence.md +33 -0
  117. package/docs/SubscriptionPlanResponse.md +8 -0
  118. package/docs/SubscriptionsApi.md +7 -10
  119. package/docs/TenantSubscriptionResponse.md +47 -0
  120. package/docs/TenantsApi.md +1 -1
  121. package/docs/TrashApi.md +76 -0
  122. package/docs/TrashItemDetailResponse.md +55 -0
  123. package/docs/TrashItemResponse.md +2 -0
  124. package/docs/UpdateWorkflowDefinitionRequest.md +6 -0
  125. package/docs/WorkflowDefinitionResponse.md +6 -0
  126. package/docs/WorkflowRunsApi.md +1 -1
  127. package/package.json +1 -1
  128. package/src/apis/BillingApi.ts +142 -0
  129. package/src/apis/DocumentVersionsApi.ts +8 -8
  130. package/src/apis/DocumentsApi.ts +4 -4
  131. package/src/apis/SubscriptionsApi.ts +24 -31
  132. package/src/apis/TenantsApi.ts +4 -4
  133. package/src/apis/TrashApi.ts +86 -0
  134. package/src/apis/WorkflowRunsApi.ts +4 -4
  135. package/src/apis/index.ts +1 -0
  136. package/src/models/BillingInterval.ts +53 -0
  137. package/src/models/BillingPaymentResponse.ts +168 -0
  138. package/src/models/BillingSystem.ts +58 -0
  139. package/src/models/ChangeSubscriptionRequest.ts +55 -0
  140. package/src/models/CheckoutAction.ts +55 -0
  141. package/src/models/{SubmitSubscriptionResponse.ts → CheckoutResponse.ts} +61 -47
  142. package/src/models/CreateWorkflowDefinitionRequest.ts +37 -0
  143. package/src/models/IdpConfig.ts +14 -0
  144. package/src/models/PaginatedResponseBillingPaymentResponse.ts +130 -0
  145. package/src/models/ScheduleCadence.ts +60 -0
  146. package/src/models/SubscriptionPlanResponse.ts +32 -0
  147. package/src/models/TenantSubscriptionResponse.ts +159 -0
  148. package/src/models/TrashItemDetailResponse.ts +194 -0
  149. package/src/models/TrashItemResponse.ts +15 -0
  150. package/src/models/UpdateWorkflowDefinitionRequest.ts +37 -0
  151. package/src/models/WorkflowDefinitionResponse.ts +31 -0
  152. package/src/models/index.ts +9 -1
  153. package/docs/SubmitSubscriptionResponse.md +0 -39
@@ -13,48 +13,62 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { CheckoutAction } from './CheckoutAction';
17
+ import {
18
+ CheckoutActionFromJSON,
19
+ CheckoutActionFromJSONTyped,
20
+ CheckoutActionToJSON,
21
+ CheckoutActionToJSONTyped,
22
+ } from './CheckoutAction';
23
+ import type { BillingSystem } from './BillingSystem';
24
+ import {
25
+ BillingSystemFromJSON,
26
+ BillingSystemFromJSONTyped,
27
+ BillingSystemToJSON,
28
+ BillingSystemToJSONTyped,
29
+ } from './BillingSystem';
30
+
16
31
  /**
17
- * Result envelope for the subscription-change submit endpoint.
18
- *
19
- * The endpoint returns immediately after the (mock-)Stripe charge is
20
- * submitted; the actual plan/seat write happens later in the Stripe
21
- * subscription webhook. ``submitted=True`` always when the route
22
- * succeeds (errors raise via the global handler).
32
+ * Result of ``POST /v1/tenants/{tenant_id}/subscriptions``.
23
33
  *
24
- * ``noop=True`` indicates the tenant is already at the requested
25
- * ``(plan, num_seats)`` no Stripe call was issued, no webhook will
26
- * arrive, and the user's account is unchanged. Symmetric with
27
- * ``StripeWebhookAck.replayed`` so client UIs can render "already
28
- * on this plan" rather than spinning a "waiting for webhook"
29
- * indicator forever.
30
- *
31
- * ``idempotency_key`` echoes the value forwarded to Stripe — clients
32
- * can store it to correlate the eventual webhook receipt with the
33
- * original request, and re-send it verbatim on retries.
34
+ * ``REDIRECT`` send the browser to ``url`` (Stripe Checkout).
35
+ * ``CREDENTIAL`` feed ``credential`` to the Ping++ JS SDK to invoke
36
+ * the chosen channel. ``SCHEDULED`` nothing to pay; the current
37
+ * billed subscription will not renew and expires at period end.
38
+ * ``APPLIED`` the change is already in effect (free-plan downgrade
39
+ * of an unbilled tenant, or a no-op request).
34
40
  * @export
35
- * @interface SubmitSubscriptionResponse
41
+ * @interface CheckoutResponse
36
42
  */
37
- export interface SubmitSubscriptionResponse {
43
+ export interface CheckoutResponse {
38
44
  /**
39
- * Always True when the submit returns 202.
40
- * @type {boolean}
41
- * @memberof SubmitSubscriptionResponse
45
+ *
46
+ * @type {CheckoutAction}
47
+ * @memberof CheckoutResponse
42
48
  */
43
- submitted: boolean;
49
+ action: CheckoutAction;
44
50
  /**
45
- * True when the tenant was already at the target ``(plan, num_seats)`` — no Stripe call was made and no webhook will arrive.
46
- * @type {boolean}
47
- * @memberof SubmitSubscriptionResponse
51
+ *
52
+ * @type {BillingSystem}
53
+ * @memberof CheckoutResponse
48
54
  */
49
- noop: boolean;
55
+ billingSystem?: BillingSystem;
50
56
  /**
51
- * Idempotency key forwarded to Stripe sourced from the ``Idempotency-Key`` request header or a server-generated uuid4 when absent.
57
+ * Stripe Checkout URL (action=REDIRECT).
52
58
  * @type {string}
53
- * @memberof SubmitSubscriptionResponse
59
+ * @memberof CheckoutResponse
54
60
  */
55
- idempotencyKey: string;
61
+ url?: string | null;
62
+ /**
63
+ * Ping++ charge credential (action=CREDENTIAL).
64
+ * @type {{ [key: string]: any; }}
65
+ * @memberof CheckoutResponse
66
+ */
67
+ credential?: { [key: string]: any; } | null;
56
68
  }
57
- export const SubmitSubscriptionResponsePropertyValidationAttributesMap: {
69
+
70
+
71
+ export const CheckoutResponsePropertyValidationAttributesMap: {
58
72
  [property: string]: {
59
73
  maxLength?: number,
60
74
  minLength?: number,
@@ -73,45 +87,45 @@ export const SubmitSubscriptionResponsePropertyValidationAttributesMap: {
73
87
 
74
88
 
75
89
  /**
76
- * Check if a given object implements the SubmitSubscriptionResponse interface.
90
+ * Check if a given object implements the CheckoutResponse interface.
77
91
  */
78
- export function instanceOfSubmitSubscriptionResponse(value: object): value is SubmitSubscriptionResponse {
79
- if (!('submitted' in value) || value['submitted'] === undefined) return false;
80
- if (!('noop' in value) || value['noop'] === undefined) return false;
81
- if (!('idempotencyKey' in value) || value['idempotencyKey'] === undefined) return false;
92
+ export function instanceOfCheckoutResponse(value: object): value is CheckoutResponse {
93
+ if (!('action' in value) || value['action'] === undefined) return false;
82
94
  return true;
83
95
  }
84
96
 
85
- export function SubmitSubscriptionResponseFromJSON(json: any): SubmitSubscriptionResponse {
86
- return SubmitSubscriptionResponseFromJSONTyped(json, false);
97
+ export function CheckoutResponseFromJSON(json: any): CheckoutResponse {
98
+ return CheckoutResponseFromJSONTyped(json, false);
87
99
  }
88
100
 
89
- export function SubmitSubscriptionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubmitSubscriptionResponse {
101
+ export function CheckoutResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CheckoutResponse {
90
102
  if (json == null) {
91
103
  return json;
92
104
  }
93
105
  return {
94
106
 
95
- 'submitted': json['submitted'],
96
- 'noop': json['noop'],
97
- 'idempotencyKey': json['idempotency_key'],
107
+ 'action': CheckoutActionFromJSON(json['action']),
108
+ 'billingSystem': json['billing_system'] == null ? undefined : BillingSystemFromJSON(json['billing_system']),
109
+ 'url': json['url'] == null ? undefined : json['url'],
110
+ 'credential': json['credential'] == null ? undefined : json['credential'],
98
111
  };
99
112
  }
100
113
 
101
- export function SubmitSubscriptionResponseToJSON(json: any): SubmitSubscriptionResponse {
102
- return SubmitSubscriptionResponseToJSONTyped(json, false);
114
+ export function CheckoutResponseToJSON(json: any): CheckoutResponse {
115
+ return CheckoutResponseToJSONTyped(json, false);
103
116
  }
104
117
 
105
- export function SubmitSubscriptionResponseToJSONTyped(value?: SubmitSubscriptionResponse | null, ignoreDiscriminator: boolean = false): any {
118
+ export function CheckoutResponseToJSONTyped(value?: CheckoutResponse | null, ignoreDiscriminator: boolean = false): any {
106
119
  if (value == null) {
107
120
  return value;
108
121
  }
109
122
 
110
123
  return {
111
124
 
112
- 'submitted': value['submitted'],
113
- 'noop': value['noop'],
114
- 'idempotency_key': value['idempotencyKey'],
125
+ 'action': CheckoutActionToJSON(value['action']),
126
+ 'billing_system': BillingSystemToJSON(value['billingSystem']),
127
+ 'url': value['url'],
128
+ 'credential': value['credential'],
115
129
  };
116
130
  }
117
131
 
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ScheduleCadence } from './ScheduleCadence';
17
+ import {
18
+ ScheduleCadenceFromJSON,
19
+ ScheduleCadenceFromJSONTyped,
20
+ ScheduleCadenceToJSON,
21
+ ScheduleCadenceToJSONTyped,
22
+ } from './ScheduleCadence';
23
+
16
24
  /**
17
25
  * Create a new workflow definition.
18
26
  *
@@ -23,6 +31,24 @@ import { mapValues } from '../runtime';
23
31
  * @interface CreateWorkflowDefinitionRequest
24
32
  */
25
33
  export interface CreateWorkflowDefinitionRequest {
34
+ /**
35
+ *
36
+ * @type {ScheduleCadence}
37
+ * @memberof CreateWorkflowDefinitionRequest
38
+ */
39
+ scheduleCadence?: ScheduleCadence;
40
+ /**
41
+ * First occurrence. Read in ``schedule_timezone``, so its local wall time, weekday and day of month drive the recurrence. A MONTHLY schedule must land on or before the 28th: Temporal silently skips months that are too short.
42
+ * @type {Date}
43
+ * @memberof CreateWorkflowDefinitionRequest
44
+ */
45
+ scheduleStartAt?: Date | null;
46
+ /**
47
+ * IANA zone the schedule fires in, e.g. ``Asia/Shanghai``. Optional: omit it to inherit the tenant timezone. Only set it to fire in a different zone than the tenant's. Must be an IANA name, not an ISO offset — an offset stops meaning the same wall clock across DST.
48
+ * @type {string}
49
+ * @memberof CreateWorkflowDefinitionRequest
50
+ */
51
+ scheduleTimezone?: string | null;
26
52
  /**
27
53
  *
28
54
  * @type {string}
@@ -78,6 +104,8 @@ export interface CreateWorkflowDefinitionRequest {
78
104
  */
79
105
  commonFilePathPartIds?: Array<string>;
80
106
  }
107
+
108
+
81
109
  export const CreateWorkflowDefinitionRequestPropertyValidationAttributesMap: {
82
110
  [property: string]: {
83
111
  maxLength?: number,
@@ -93,6 +121,9 @@ export const CreateWorkflowDefinitionRequestPropertyValidationAttributesMap: {
93
121
  uniqueItems?: boolean
94
122
  }
95
123
  } = {
124
+ scheduleTimezone: {
125
+ maxLength: 64,
126
+ },
96
127
  name: {
97
128
  maxLength: 255,
98
129
  },
@@ -133,6 +164,9 @@ export function CreateWorkflowDefinitionRequestFromJSONTyped(json: any, ignoreDi
133
164
  }
134
165
  return {
135
166
 
167
+ 'scheduleCadence': json['schedule_cadence'] == null ? undefined : ScheduleCadenceFromJSON(json['schedule_cadence']),
168
+ 'scheduleStartAt': json['schedule_start_at'] == null ? undefined : (new Date(json['schedule_start_at'])),
169
+ 'scheduleTimezone': json['schedule_timezone'] == null ? undefined : json['schedule_timezone'],
136
170
  'name': json['name'],
137
171
  'description': json['description'] == null ? undefined : json['description'],
138
172
  'maxRunDurationSeconds': json['max_run_duration_seconds'] == null ? undefined : json['max_run_duration_seconds'],
@@ -156,6 +190,9 @@ export function CreateWorkflowDefinitionRequestToJSONTyped(value?: CreateWorkflo
156
190
 
157
191
  return {
158
192
 
193
+ 'schedule_cadence': ScheduleCadenceToJSON(value['scheduleCadence']),
194
+ 'schedule_start_at': value['scheduleStartAt'] == null ? value['scheduleStartAt'] : value['scheduleStartAt'].toISOString(),
195
+ 'schedule_timezone': value['scheduleTimezone'],
159
196
  'name': value['name'],
160
197
  'description': value['description'],
161
198
  'max_run_duration_seconds': value['maxRunDurationSeconds'],
@@ -43,6 +43,12 @@ export interface IdpConfig {
43
43
  * @memberof IdpConfig
44
44
  */
45
45
  _configuration: { [key: string]: any; };
46
+ /**
47
+ * Crontab string for directory sync
48
+ * @type {string}
49
+ * @memberof IdpConfig
50
+ */
51
+ syncCrontab?: string | null;
46
52
  }
47
53
 
48
54
 
@@ -61,6 +67,12 @@ export const IdpConfigPropertyValidationAttributesMap: {
61
67
  uniqueItems?: boolean
62
68
  }
63
69
  } = {
70
+ _configuration: {
71
+ minItems: 1,
72
+ },
73
+ syncCrontab: {
74
+ minLength: 9,
75
+ },
64
76
  }
65
77
 
66
78
 
@@ -85,6 +97,7 @@ export function IdpConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean):
85
97
 
86
98
  'provider': SupportedIdPFromJSON(json['provider']),
87
99
  '_configuration': json['configuration'],
100
+ 'syncCrontab': json['sync_crontab'] == null ? undefined : json['sync_crontab'],
88
101
  };
89
102
  }
90
103
 
@@ -101,6 +114,7 @@ export function IdpConfigToJSONTyped(value?: IdpConfig | null, ignoreDiscriminat
101
114
 
102
115
  'provider': SupportedIdPToJSON(value['provider']),
103
116
  'configuration': value['_configuration'],
117
+ 'sync_crontab': value['syncCrontab'],
104
118
  };
105
119
  }
106
120
 
@@ -0,0 +1,130 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { BillingPaymentResponse } from './BillingPaymentResponse';
17
+ import {
18
+ BillingPaymentResponseFromJSON,
19
+ BillingPaymentResponseFromJSONTyped,
20
+ BillingPaymentResponseToJSON,
21
+ BillingPaymentResponseToJSONTyped,
22
+ } from './BillingPaymentResponse';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface PaginatedResponseBillingPaymentResponse
28
+ */
29
+ export interface PaginatedResponseBillingPaymentResponse {
30
+ /**
31
+ * List of items
32
+ * @type {Array<BillingPaymentResponse>}
33
+ * @memberof PaginatedResponseBillingPaymentResponse
34
+ */
35
+ items: Array<BillingPaymentResponse>;
36
+ /**
37
+ * Total number of items
38
+ * @type {number}
39
+ * @memberof PaginatedResponseBillingPaymentResponse
40
+ */
41
+ total: number;
42
+ /**
43
+ * Number of items per page
44
+ * @type {number}
45
+ * @memberof PaginatedResponseBillingPaymentResponse
46
+ */
47
+ limit: number;
48
+ /**
49
+ * Number of items to skip
50
+ * @type {number}
51
+ * @memberof PaginatedResponseBillingPaymentResponse
52
+ */
53
+ offset: number;
54
+ }
55
+ export const PaginatedResponseBillingPaymentResponsePropertyValidationAttributesMap: {
56
+ [property: string]: {
57
+ maxLength?: number,
58
+ minLength?: number,
59
+ pattern?: string,
60
+ maximum?: number,
61
+ exclusiveMaximum?: boolean,
62
+ minimum?: number,
63
+ exclusiveMinimum?: boolean,
64
+ multipleOf?: number,
65
+ maxItems?: number,
66
+ minItems?: number,
67
+ uniqueItems?: boolean
68
+ }
69
+ } = {
70
+ total: {
71
+ minimum: 0,
72
+ exclusiveMinimum: false,
73
+ },
74
+ limit: {
75
+ minimum: 1,
76
+ exclusiveMinimum: false,
77
+ },
78
+ offset: {
79
+ minimum: 0,
80
+ exclusiveMinimum: false,
81
+ },
82
+ }
83
+
84
+
85
+ /**
86
+ * Check if a given object implements the PaginatedResponseBillingPaymentResponse interface.
87
+ */
88
+ export function instanceOfPaginatedResponseBillingPaymentResponse(value: object): value is PaginatedResponseBillingPaymentResponse {
89
+ if (!('items' in value) || value['items'] === undefined) return false;
90
+ if (!('total' in value) || value['total'] === undefined) return false;
91
+ if (!('limit' in value) || value['limit'] === undefined) return false;
92
+ if (!('offset' in value) || value['offset'] === undefined) return false;
93
+ return true;
94
+ }
95
+
96
+ export function PaginatedResponseBillingPaymentResponseFromJSON(json: any): PaginatedResponseBillingPaymentResponse {
97
+ return PaginatedResponseBillingPaymentResponseFromJSONTyped(json, false);
98
+ }
99
+
100
+ export function PaginatedResponseBillingPaymentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedResponseBillingPaymentResponse {
101
+ if (json == null) {
102
+ return json;
103
+ }
104
+ return {
105
+
106
+ 'items': ((json['items'] as Array<any>).map(BillingPaymentResponseFromJSON)),
107
+ 'total': json['total'],
108
+ 'limit': json['limit'],
109
+ 'offset': json['offset'],
110
+ };
111
+ }
112
+
113
+ export function PaginatedResponseBillingPaymentResponseToJSON(json: any): PaginatedResponseBillingPaymentResponse {
114
+ return PaginatedResponseBillingPaymentResponseToJSONTyped(json, false);
115
+ }
116
+
117
+ export function PaginatedResponseBillingPaymentResponseToJSONTyped(value?: PaginatedResponseBillingPaymentResponse | null, ignoreDiscriminator: boolean = false): any {
118
+ if (value == null) {
119
+ return value;
120
+ }
121
+
122
+ return {
123
+
124
+ 'items': ((value['items'] as Array<any>).map(BillingPaymentResponseToJSON)),
125
+ 'total': value['total'],
126
+ 'limit': value['limit'],
127
+ 'offset': value['offset'],
128
+ };
129
+ }
130
+
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ * How often a workflow definition runs itself.
18
+ *
19
+ * The cadence names the recurrence; the time of day, weekday and day of
20
+ * month all come from the definition's ``schedule_start_at``, so an illegal
21
+ * combination (a daily cadence carrying a weekday, say) cannot be expressed.
22
+ * ``None`` on the definition means manual-only — the state every definition
23
+ * is in today.
24
+ * @export
25
+ */
26
+ export const ScheduleCadence = {
27
+ Daily: 'DAILY',
28
+ Weekly: 'WEEKLY',
29
+ Monthly: 'MONTHLY'
30
+ } as const;
31
+ export type ScheduleCadence = typeof ScheduleCadence[keyof typeof ScheduleCadence];
32
+
33
+
34
+ export function instanceOfScheduleCadence(value: any): boolean {
35
+ for (const key in ScheduleCadence) {
36
+ if (Object.prototype.hasOwnProperty.call(ScheduleCadence, key)) {
37
+ if (ScheduleCadence[key as keyof typeof ScheduleCadence] === value) {
38
+ return true;
39
+ }
40
+ }
41
+ }
42
+ return false;
43
+ }
44
+
45
+ export function ScheduleCadenceFromJSON(json: any): ScheduleCadence {
46
+ return ScheduleCadenceFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ScheduleCadenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScheduleCadence {
50
+ return json as ScheduleCadence;
51
+ }
52
+
53
+ export function ScheduleCadenceToJSON(value?: ScheduleCadence | null): any {
54
+ return value as any;
55
+ }
56
+
57
+ export function ScheduleCadenceToJSONTyped(value: any, ignoreDiscriminator: boolean): ScheduleCadence {
58
+ return value as ScheduleCadence;
59
+ }
60
+
@@ -73,6 +73,30 @@ export interface SubscriptionPlanResponse {
73
73
  * @memberof SubscriptionPlanResponse
74
74
  */
75
75
  _public: boolean;
76
+ /**
77
+ * Per-seat monthly price in USD cents (Stripe / NA). NULL = not self-serve purchasable in this currency/interval.
78
+ * @type {number}
79
+ * @memberof SubscriptionPlanResponse
80
+ */
81
+ priceMonthlyUsdCents?: number | null;
82
+ /**
83
+ * Per-seat annual price in USD cents (Stripe / NA).
84
+ * @type {number}
85
+ * @memberof SubscriptionPlanResponse
86
+ */
87
+ priceAnnualUsdCents?: number | null;
88
+ /**
89
+ * Per-seat monthly price in CNY fen (Ping++ / CN).
90
+ * @type {number}
91
+ * @memberof SubscriptionPlanResponse
92
+ */
93
+ priceMonthlyCnyFen?: number | null;
94
+ /**
95
+ * Per-seat annual price in CNY fen (Ping++ / CN).
96
+ * @type {number}
97
+ * @memberof SubscriptionPlanResponse
98
+ */
99
+ priceAnnualCnyFen?: number | null;
76
100
  /**
77
101
  * Plan creation timestamp.
78
102
  * @type {Date}
@@ -139,6 +163,10 @@ export function SubscriptionPlanResponseFromJSONTyped(json: any, ignoreDiscrimin
139
163
  'mediaMinutes': json['media_minutes'],
140
164
  'maxSeats': json['max_seats'],
141
165
  '_public': json['public'],
166
+ 'priceMonthlyUsdCents': json['price_monthly_usd_cents'] == null ? undefined : json['price_monthly_usd_cents'],
167
+ 'priceAnnualUsdCents': json['price_annual_usd_cents'] == null ? undefined : json['price_annual_usd_cents'],
168
+ 'priceMonthlyCnyFen': json['price_monthly_cny_fen'] == null ? undefined : json['price_monthly_cny_fen'],
169
+ 'priceAnnualCnyFen': json['price_annual_cny_fen'] == null ? undefined : json['price_annual_cny_fen'],
142
170
  'createdAt': (new Date(json['created_at'])),
143
171
  'updatedAt': (new Date(json['updated_at'])),
144
172
  };
@@ -163,6 +191,10 @@ export function SubscriptionPlanResponseToJSONTyped(value?: SubscriptionPlanResp
163
191
  'media_minutes': value['mediaMinutes'],
164
192
  'max_seats': value['maxSeats'],
165
193
  'public': value['_public'],
194
+ 'price_monthly_usd_cents': value['priceMonthlyUsdCents'],
195
+ 'price_annual_usd_cents': value['priceAnnualUsdCents'],
196
+ 'price_monthly_cny_fen': value['priceMonthlyCnyFen'],
197
+ 'price_annual_cny_fen': value['priceAnnualCnyFen'],
166
198
  'created_at': value['createdAt'].toISOString(),
167
199
  'updated_at': value['updatedAt'].toISOString(),
168
200
  };