@zyphr-dev/node-sdk 0.1.39 → 0.1.41
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.cjs +2315 -1220
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1724 -622
- package/dist/index.d.ts +1724 -622
- package/dist/index.js +2195 -1203
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +24 -4
- package/src/src/apis/AuthRegistrationApi.ts +4 -4
- package/src/src/apis/WorkflowsApi.ts +912 -0
- package/src/src/apis/index.ts +1 -1
- package/src/src/models/AddWorkflowStep201Response.ts +88 -0
- package/src/src/models/AddWorkflowStepRequest.ts +136 -0
- package/src/src/models/CreateWorkflow201Response.ts +88 -0
- package/src/src/models/CreateWorkflowRequest.ts +98 -0
- package/src/src/models/DeleteWorkflow200Response.ts +88 -0
- package/src/src/models/{TopicDeleteResponseData.ts → DeleteWorkflow200ResponseData.ts} +12 -12
- package/src/src/models/DeleteWorkflowStep200Response.ts +88 -0
- package/src/src/models/DeleteWorkflowStep200ResponseData.ts +81 -0
- package/src/src/models/ListWorkflowExecutions200Response.ts +88 -0
- package/src/src/models/{SmsListResponseMeta.ts → ListWorkflowExecutions200ResponseMeta.ts} +15 -15
- package/src/src/models/ListWorkflows200Response.ts +88 -0
- package/src/src/models/ListWorkflows200ResponseMeta.ts +121 -0
- package/src/src/models/ReorderWorkflowStepsRequest.ts +66 -0
- package/src/src/models/SignInWithGameCenterRequest.ts +1 -1
- package/src/src/models/SmsListResponse.ts +10 -10
- package/src/src/models/TopicDeleteResponse.ts +10 -10
- package/src/src/models/TriggerWorkflow202Response.ts +88 -0
- package/src/src/models/TriggerWorkflow202ResponseData.ts +81 -0
- package/src/src/models/TriggerWorkflowRequest.ts +90 -0
- package/src/src/models/UpdateWorkflowRequest.ts +89 -0
- package/src/src/models/UpdateWorkflowStatusRequest.ts +76 -0
- package/src/src/models/UpdateWorkflowStepRequest.ts +73 -0
- package/src/src/models/Workflow.ts +187 -0
- package/src/src/models/WorkflowStatus.ts +55 -0
- package/src/src/models/WorkflowStep.ts +176 -0
- package/src/src/models/WorkflowStepType.ts +60 -0
- package/src/src/models/index.ts +23 -3
- package/src/src/apis/MuseApi.ts +0 -531
- package/src/src/models/V1MuseSubjectsSuggestPostRequest.ts +0 -105
package/src/src/apis/MuseApi.ts
DELETED
|
@@ -1,531 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Zyphr API
|
|
5
|
-
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0.0
|
|
8
|
-
* Contact: support@zyphr.dev
|
|
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
|
-
import * as runtime from '../runtime';
|
|
17
|
-
import type {
|
|
18
|
-
V1MuseSubjectsSuggestPostRequest,
|
|
19
|
-
} from '../models/index';
|
|
20
|
-
import {
|
|
21
|
-
V1MuseSubjectsSuggestPostRequestFromJSON,
|
|
22
|
-
V1MuseSubjectsSuggestPostRequestToJSON,
|
|
23
|
-
} from '../models/index';
|
|
24
|
-
|
|
25
|
-
export interface MuseApiV1MuseSettingsProjectIdGetRequest {
|
|
26
|
-
projectId: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface MuseApiV1MuseSettingsProjectIdPatchRequest {
|
|
30
|
-
projectId: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface MuseApiV1MuseSubjectsSuggestPostOperationRequest {
|
|
34
|
-
v1MuseSubjectsSuggestPostRequest: V1MuseSubjectsSuggestPostRequest;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* MuseApi - interface
|
|
39
|
-
*
|
|
40
|
-
* @export
|
|
41
|
-
* @interface MuseApiInterface
|
|
42
|
-
*/
|
|
43
|
-
export interface MuseApiInterface {
|
|
44
|
-
/**
|
|
45
|
-
* Returns Muse invocations for the caller\'s account, ordered by most recent first. The request_payload is the PII-scrubbed payload we record at call time; the response payload is NOT returned by this endpoint for size reasons (use the per-row detail endpoint when built).
|
|
46
|
-
* @summary Paginated per-call audit log for Muse
|
|
47
|
-
* @param {*} [options] Override http request option.
|
|
48
|
-
* @throws {RequiredError}
|
|
49
|
-
* @memberof MuseApiInterface
|
|
50
|
-
*/
|
|
51
|
-
v1MuseAuditLogGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Returns Muse invocations for the caller\'s account, ordered by most recent first. The request_payload is the PII-scrubbed payload we record at call time; the response payload is NOT returned by this endpoint for size reasons (use the per-row detail endpoint when built).
|
|
55
|
-
* Paginated per-call audit log for Muse
|
|
56
|
-
*/
|
|
57
|
-
v1MuseAuditLogGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Streams Opus tokens then emits a structured advisory covering deliverability risks, frequency conflicts, audience warnings, send-time suggestions, and content notes — plus a single recommended_action so the dashboard can render a CTA without interpreting prose. Advisory is purely advisory — the platform does not block sends on AI output.
|
|
61
|
-
* @summary Stream a pre-send advisory for a draft broadcast
|
|
62
|
-
* @param {*} [options] Override http request option.
|
|
63
|
-
* @throws {RequiredError}
|
|
64
|
-
* @memberof MuseApiInterface
|
|
65
|
-
*/
|
|
66
|
-
v1MuseBroadcastsAnalyzePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Streams Opus tokens then emits a structured advisory covering deliverability risks, frequency conflicts, audience warnings, send-time suggestions, and content notes — plus a single recommended_action so the dashboard can render a CTA without interpreting prose. Advisory is purely advisory — the platform does not block sends on AI output.
|
|
70
|
-
* Stream a pre-send advisory for a draft broadcast
|
|
71
|
-
*/
|
|
72
|
-
v1MuseBroadcastsAnalyzePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Returns whether the caller\'s account plan unlocks Zyphr Muse, the cheapest plan that would unlock it, and the monthly Bedrock spend cap for the current plan. Available to every authenticated caller (including free accounts).
|
|
76
|
-
* @summary Return the current account\'s Zyphr Muse entitlement
|
|
77
|
-
* @param {*} [options] Override http request option.
|
|
78
|
-
* @throws {RequiredError}
|
|
79
|
-
* @memberof MuseApiInterface
|
|
80
|
-
*/
|
|
81
|
-
v1MuseEntitlementGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Returns whether the caller\'s account plan unlocks Zyphr Muse, the cheapest plan that would unlock it, and the monthly Bedrock spend cap for the current plan. Available to every authenticated caller (including free accounts).
|
|
85
|
-
* Return the current account\'s Zyphr Muse entitlement
|
|
86
|
-
*/
|
|
87
|
-
v1MuseEntitlementGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Reads the committed baseline JSON files from src/services/muse/evals/baselines/ and returns them keyed by prompt name. Customers don\'t see this — it\'s for the internal Muse settings page / admin portal.
|
|
91
|
-
* @summary Per-prompt eval baseline snapshots
|
|
92
|
-
* @param {*} [options] Override http request option.
|
|
93
|
-
* @throws {RequiredError}
|
|
94
|
-
* @memberof MuseApiInterface
|
|
95
|
-
*/
|
|
96
|
-
v1MuseEvalBaselinesGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Reads the committed baseline JSON files from src/services/muse/evals/baselines/ and returns them keyed by prompt name. Customers don\'t see this — it\'s for the internal Muse settings page / admin portal.
|
|
100
|
-
* Per-prompt eval baseline snapshots
|
|
101
|
-
*/
|
|
102
|
-
v1MuseEvalBaselinesGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Returns the project\'s Muse settings (cap override, allowed roles, blocked tiers). If no row exists yet, returns synthesized defaults so the caller never sees a 404.
|
|
106
|
-
* @summary Read Muse settings for a project
|
|
107
|
-
* @param {string} projectId
|
|
108
|
-
* @param {*} [options] Override http request option.
|
|
109
|
-
* @throws {RequiredError}
|
|
110
|
-
* @memberof MuseApiInterface
|
|
111
|
-
*/
|
|
112
|
-
v1MuseSettingsProjectIdGetRaw(requestParameters: MuseApiV1MuseSettingsProjectIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Returns the project\'s Muse settings (cap override, allowed roles, blocked tiers). If no row exists yet, returns synthesized defaults so the caller never sees a 404.
|
|
116
|
-
* Read Muse settings for a project
|
|
117
|
-
*/
|
|
118
|
-
v1MuseSettingsProjectIdGet(projectId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Partial update — any omitted field keeps its existing value. Pass `monthly_cap_usd_override: null` to clear an override. Requires project-level role admin or developer. Account owner/admin cascades.
|
|
122
|
-
* @summary Update Muse settings for a project (admin or developer only)
|
|
123
|
-
* @param {string} projectId
|
|
124
|
-
* @param {*} [options] Override http request option.
|
|
125
|
-
* @throws {RequiredError}
|
|
126
|
-
* @memberof MuseApiInterface
|
|
127
|
-
*/
|
|
128
|
-
v1MuseSettingsProjectIdPatchRaw(requestParameters: MuseApiV1MuseSettingsProjectIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Partial update — any omitted field keeps its existing value. Pass `monthly_cap_usd_override: null` to clear an override. Requires project-level role admin or developer. Account owner/admin cascades.
|
|
132
|
-
* Update Muse settings for a project (admin or developer only)
|
|
133
|
-
*/
|
|
134
|
-
v1MuseSettingsProjectIdPatch(projectId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
* @summary Suggest 5 ranked subject-line candidates for a template
|
|
139
|
-
* @param {V1MuseSubjectsSuggestPostRequest} v1MuseSubjectsSuggestPostRequest
|
|
140
|
-
* @param {*} [options] Override http request option.
|
|
141
|
-
* @throws {RequiredError}
|
|
142
|
-
* @memberof MuseApiInterface
|
|
143
|
-
*/
|
|
144
|
-
v1MuseSubjectsSuggestPostRaw(requestParameters: MuseApiV1MuseSubjectsSuggestPostOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Suggest 5 ranked subject-line candidates for a template
|
|
148
|
-
*/
|
|
149
|
-
v1MuseSubjectsSuggestPost(v1MuseSubjectsSuggestPostRequest: V1MuseSubjectsSuggestPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
* @summary Stream a draft template from a natural-language brief
|
|
154
|
-
* @param {*} [options] Override http request option.
|
|
155
|
-
* @throws {RequiredError}
|
|
156
|
-
* @memberof MuseApiInterface
|
|
157
|
-
*/
|
|
158
|
-
v1MuseTemplatesDraftPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Stream a draft template from a natural-language brief
|
|
162
|
-
*/
|
|
163
|
-
v1MuseTemplatesDraftPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
*
|
|
167
|
-
* @summary Stream a rewritten block per the user\'s instruction
|
|
168
|
-
* @param {*} [options] Override http request option.
|
|
169
|
-
* @throws {RequiredError}
|
|
170
|
-
* @memberof MuseApiInterface
|
|
171
|
-
*/
|
|
172
|
-
v1MuseTemplatesRewritePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Stream a rewritten block per the user\'s instruction
|
|
176
|
-
*/
|
|
177
|
-
v1MuseTemplatesRewritePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Current calendar-month spend, plan cap, soft warning tier, and breakdowns by action and model tier. Dashboard polls this for the budget meter; 60s edge-cached via Redis is reasonable but not enforced server-side (lightweight aggregate).
|
|
181
|
-
* @summary Per-account Zyphr Muse usage + budget tier
|
|
182
|
-
* @param {*} [options] Override http request option.
|
|
183
|
-
* @throws {RequiredError}
|
|
184
|
-
* @memberof MuseApiInterface
|
|
185
|
-
*/
|
|
186
|
-
v1MuseUsageGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Current calendar-month spend, plan cap, soft warning tier, and breakdowns by action and model tier. Dashboard polls this for the budget meter; 60s edge-cached via Redis is reasonable but not enforced server-side (lightweight aggregate).
|
|
190
|
-
* Per-account Zyphr Muse usage + budget tier
|
|
191
|
-
*/
|
|
192
|
-
v1MuseUsageGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Streams Opus tokens then emits a fully-validated workflow JSON object (single root, no cycles, branch_path coherent, all step types valid). Channels referenced by the workflow must appear in the project\'s available_channels grounding; unsupported channels fall back to email via the prompt\'s hard rules.
|
|
196
|
-
* @summary Stream a generated workflow from a natural-language description
|
|
197
|
-
* @param {*} [options] Override http request option.
|
|
198
|
-
* @throws {RequiredError}
|
|
199
|
-
* @memberof MuseApiInterface
|
|
200
|
-
*/
|
|
201
|
-
v1MuseWorkflowsGeneratePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Streams Opus tokens then emits a fully-validated workflow JSON object (single root, no cycles, branch_path coherent, all step types valid). Channels referenced by the workflow must appear in the project\'s available_channels grounding; unsupported channels fall back to email via the prompt\'s hard rules.
|
|
205
|
-
* Stream a generated workflow from a natural-language description
|
|
206
|
-
*/
|
|
207
|
-
v1MuseWorkflowsGeneratePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
*
|
|
213
|
-
*/
|
|
214
|
-
export class MuseApi extends runtime.BaseAPI implements MuseApiInterface {
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Returns Muse invocations for the caller\'s account, ordered by most recent first. The request_payload is the PII-scrubbed payload we record at call time; the response payload is NOT returned by this endpoint for size reasons (use the per-row detail endpoint when built).
|
|
218
|
-
* Paginated per-call audit log for Muse
|
|
219
|
-
*/
|
|
220
|
-
async v1MuseAuditLogGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
221
|
-
const queryParameters: any = {};
|
|
222
|
-
|
|
223
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
224
|
-
|
|
225
|
-
const response = await this.request({
|
|
226
|
-
path: `/v1/muse/audit-log`,
|
|
227
|
-
method: 'GET',
|
|
228
|
-
headers: headerParameters,
|
|
229
|
-
query: queryParameters,
|
|
230
|
-
}, initOverrides);
|
|
231
|
-
|
|
232
|
-
return new runtime.VoidApiResponse(response);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Returns Muse invocations for the caller\'s account, ordered by most recent first. The request_payload is the PII-scrubbed payload we record at call time; the response payload is NOT returned by this endpoint for size reasons (use the per-row detail endpoint when built).
|
|
237
|
-
* Paginated per-call audit log for Muse
|
|
238
|
-
*/
|
|
239
|
-
async v1MuseAuditLogGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
240
|
-
await this.v1MuseAuditLogGetRaw(initOverrides);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Streams Opus tokens then emits a structured advisory covering deliverability risks, frequency conflicts, audience warnings, send-time suggestions, and content notes — plus a single recommended_action so the dashboard can render a CTA without interpreting prose. Advisory is purely advisory — the platform does not block sends on AI output.
|
|
245
|
-
* Stream a pre-send advisory for a draft broadcast
|
|
246
|
-
*/
|
|
247
|
-
async v1MuseBroadcastsAnalyzePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
248
|
-
const queryParameters: any = {};
|
|
249
|
-
|
|
250
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
251
|
-
|
|
252
|
-
const response = await this.request({
|
|
253
|
-
path: `/v1/muse/broadcasts/analyze`,
|
|
254
|
-
method: 'POST',
|
|
255
|
-
headers: headerParameters,
|
|
256
|
-
query: queryParameters,
|
|
257
|
-
}, initOverrides);
|
|
258
|
-
|
|
259
|
-
return new runtime.VoidApiResponse(response);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Streams Opus tokens then emits a structured advisory covering deliverability risks, frequency conflicts, audience warnings, send-time suggestions, and content notes — plus a single recommended_action so the dashboard can render a CTA without interpreting prose. Advisory is purely advisory — the platform does not block sends on AI output.
|
|
264
|
-
* Stream a pre-send advisory for a draft broadcast
|
|
265
|
-
*/
|
|
266
|
-
async v1MuseBroadcastsAnalyzePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
267
|
-
await this.v1MuseBroadcastsAnalyzePostRaw(initOverrides);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Returns whether the caller\'s account plan unlocks Zyphr Muse, the cheapest plan that would unlock it, and the monthly Bedrock spend cap for the current plan. Available to every authenticated caller (including free accounts).
|
|
272
|
-
* Return the current account\'s Zyphr Muse entitlement
|
|
273
|
-
*/
|
|
274
|
-
async v1MuseEntitlementGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
275
|
-
const queryParameters: any = {};
|
|
276
|
-
|
|
277
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
278
|
-
|
|
279
|
-
const response = await this.request({
|
|
280
|
-
path: `/v1/muse/entitlement`,
|
|
281
|
-
method: 'GET',
|
|
282
|
-
headers: headerParameters,
|
|
283
|
-
query: queryParameters,
|
|
284
|
-
}, initOverrides);
|
|
285
|
-
|
|
286
|
-
return new runtime.VoidApiResponse(response);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Returns whether the caller\'s account plan unlocks Zyphr Muse, the cheapest plan that would unlock it, and the monthly Bedrock spend cap for the current plan. Available to every authenticated caller (including free accounts).
|
|
291
|
-
* Return the current account\'s Zyphr Muse entitlement
|
|
292
|
-
*/
|
|
293
|
-
async v1MuseEntitlementGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
294
|
-
await this.v1MuseEntitlementGetRaw(initOverrides);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Reads the committed baseline JSON files from src/services/muse/evals/baselines/ and returns them keyed by prompt name. Customers don\'t see this — it\'s for the internal Muse settings page / admin portal.
|
|
299
|
-
* Per-prompt eval baseline snapshots
|
|
300
|
-
*/
|
|
301
|
-
async v1MuseEvalBaselinesGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
302
|
-
const queryParameters: any = {};
|
|
303
|
-
|
|
304
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
305
|
-
|
|
306
|
-
const response = await this.request({
|
|
307
|
-
path: `/v1/muse/eval-baselines`,
|
|
308
|
-
method: 'GET',
|
|
309
|
-
headers: headerParameters,
|
|
310
|
-
query: queryParameters,
|
|
311
|
-
}, initOverrides);
|
|
312
|
-
|
|
313
|
-
return new runtime.VoidApiResponse(response);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Reads the committed baseline JSON files from src/services/muse/evals/baselines/ and returns them keyed by prompt name. Customers don\'t see this — it\'s for the internal Muse settings page / admin portal.
|
|
318
|
-
* Per-prompt eval baseline snapshots
|
|
319
|
-
*/
|
|
320
|
-
async v1MuseEvalBaselinesGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
321
|
-
await this.v1MuseEvalBaselinesGetRaw(initOverrides);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Returns the project\'s Muse settings (cap override, allowed roles, blocked tiers). If no row exists yet, returns synthesized defaults so the caller never sees a 404.
|
|
326
|
-
* Read Muse settings for a project
|
|
327
|
-
*/
|
|
328
|
-
async v1MuseSettingsProjectIdGetRaw(requestParameters: MuseApiV1MuseSettingsProjectIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
329
|
-
if (requestParameters['projectId'] == null) {
|
|
330
|
-
throw new runtime.RequiredError(
|
|
331
|
-
'projectId',
|
|
332
|
-
'Required parameter "projectId" was null or undefined when calling v1MuseSettingsProjectIdGet().'
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const queryParameters: any = {};
|
|
337
|
-
|
|
338
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
339
|
-
|
|
340
|
-
const response = await this.request({
|
|
341
|
-
path: `/v1/muse/settings/{project_id}`.replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))),
|
|
342
|
-
method: 'GET',
|
|
343
|
-
headers: headerParameters,
|
|
344
|
-
query: queryParameters,
|
|
345
|
-
}, initOverrides);
|
|
346
|
-
|
|
347
|
-
return new runtime.VoidApiResponse(response);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Returns the project\'s Muse settings (cap override, allowed roles, blocked tiers). If no row exists yet, returns synthesized defaults so the caller never sees a 404.
|
|
352
|
-
* Read Muse settings for a project
|
|
353
|
-
*/
|
|
354
|
-
async v1MuseSettingsProjectIdGet(projectId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
355
|
-
await this.v1MuseSettingsProjectIdGetRaw({ projectId: projectId }, initOverrides);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Partial update — any omitted field keeps its existing value. Pass `monthly_cap_usd_override: null` to clear an override. Requires project-level role admin or developer. Account owner/admin cascades.
|
|
360
|
-
* Update Muse settings for a project (admin or developer only)
|
|
361
|
-
*/
|
|
362
|
-
async v1MuseSettingsProjectIdPatchRaw(requestParameters: MuseApiV1MuseSettingsProjectIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
363
|
-
if (requestParameters['projectId'] == null) {
|
|
364
|
-
throw new runtime.RequiredError(
|
|
365
|
-
'projectId',
|
|
366
|
-
'Required parameter "projectId" was null or undefined when calling v1MuseSettingsProjectIdPatch().'
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
const queryParameters: any = {};
|
|
371
|
-
|
|
372
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
373
|
-
|
|
374
|
-
const response = await this.request({
|
|
375
|
-
path: `/v1/muse/settings/{project_id}`.replace(`{${"project_id"}}`, encodeURIComponent(String(requestParameters['projectId']))),
|
|
376
|
-
method: 'PATCH',
|
|
377
|
-
headers: headerParameters,
|
|
378
|
-
query: queryParameters,
|
|
379
|
-
}, initOverrides);
|
|
380
|
-
|
|
381
|
-
return new runtime.VoidApiResponse(response);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Partial update — any omitted field keeps its existing value. Pass `monthly_cap_usd_override: null` to clear an override. Requires project-level role admin or developer. Account owner/admin cascades.
|
|
386
|
-
* Update Muse settings for a project (admin or developer only)
|
|
387
|
-
*/
|
|
388
|
-
async v1MuseSettingsProjectIdPatch(projectId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
389
|
-
await this.v1MuseSettingsProjectIdPatchRaw({ projectId: projectId }, initOverrides);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Suggest 5 ranked subject-line candidates for a template
|
|
394
|
-
*/
|
|
395
|
-
async v1MuseSubjectsSuggestPostRaw(requestParameters: MuseApiV1MuseSubjectsSuggestPostOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
396
|
-
if (requestParameters['v1MuseSubjectsSuggestPostRequest'] == null) {
|
|
397
|
-
throw new runtime.RequiredError(
|
|
398
|
-
'v1MuseSubjectsSuggestPostRequest',
|
|
399
|
-
'Required parameter "v1MuseSubjectsSuggestPostRequest" was null or undefined when calling v1MuseSubjectsSuggestPost().'
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
const queryParameters: any = {};
|
|
404
|
-
|
|
405
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
406
|
-
|
|
407
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
408
|
-
|
|
409
|
-
const response = await this.request({
|
|
410
|
-
path: `/v1/muse/subjects/suggest`,
|
|
411
|
-
method: 'POST',
|
|
412
|
-
headers: headerParameters,
|
|
413
|
-
query: queryParameters,
|
|
414
|
-
body: V1MuseSubjectsSuggestPostRequestToJSON(requestParameters['v1MuseSubjectsSuggestPostRequest']),
|
|
415
|
-
}, initOverrides);
|
|
416
|
-
|
|
417
|
-
return new runtime.VoidApiResponse(response);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Suggest 5 ranked subject-line candidates for a template
|
|
422
|
-
*/
|
|
423
|
-
async v1MuseSubjectsSuggestPost(v1MuseSubjectsSuggestPostRequest: V1MuseSubjectsSuggestPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
424
|
-
await this.v1MuseSubjectsSuggestPostRaw({ v1MuseSubjectsSuggestPostRequest: v1MuseSubjectsSuggestPostRequest }, initOverrides);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Stream a draft template from a natural-language brief
|
|
429
|
-
*/
|
|
430
|
-
async v1MuseTemplatesDraftPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
431
|
-
const queryParameters: any = {};
|
|
432
|
-
|
|
433
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
434
|
-
|
|
435
|
-
const response = await this.request({
|
|
436
|
-
path: `/v1/muse/templates/draft`,
|
|
437
|
-
method: 'POST',
|
|
438
|
-
headers: headerParameters,
|
|
439
|
-
query: queryParameters,
|
|
440
|
-
}, initOverrides);
|
|
441
|
-
|
|
442
|
-
return new runtime.VoidApiResponse(response);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Stream a draft template from a natural-language brief
|
|
447
|
-
*/
|
|
448
|
-
async v1MuseTemplatesDraftPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
449
|
-
await this.v1MuseTemplatesDraftPostRaw(initOverrides);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Stream a rewritten block per the user\'s instruction
|
|
454
|
-
*/
|
|
455
|
-
async v1MuseTemplatesRewritePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
456
|
-
const queryParameters: any = {};
|
|
457
|
-
|
|
458
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
459
|
-
|
|
460
|
-
const response = await this.request({
|
|
461
|
-
path: `/v1/muse/templates/rewrite`,
|
|
462
|
-
method: 'POST',
|
|
463
|
-
headers: headerParameters,
|
|
464
|
-
query: queryParameters,
|
|
465
|
-
}, initOverrides);
|
|
466
|
-
|
|
467
|
-
return new runtime.VoidApiResponse(response);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Stream a rewritten block per the user\'s instruction
|
|
472
|
-
*/
|
|
473
|
-
async v1MuseTemplatesRewritePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
474
|
-
await this.v1MuseTemplatesRewritePostRaw(initOverrides);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* Current calendar-month spend, plan cap, soft warning tier, and breakdowns by action and model tier. Dashboard polls this for the budget meter; 60s edge-cached via Redis is reasonable but not enforced server-side (lightweight aggregate).
|
|
479
|
-
* Per-account Zyphr Muse usage + budget tier
|
|
480
|
-
*/
|
|
481
|
-
async v1MuseUsageGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
482
|
-
const queryParameters: any = {};
|
|
483
|
-
|
|
484
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
485
|
-
|
|
486
|
-
const response = await this.request({
|
|
487
|
-
path: `/v1/muse/usage`,
|
|
488
|
-
method: 'GET',
|
|
489
|
-
headers: headerParameters,
|
|
490
|
-
query: queryParameters,
|
|
491
|
-
}, initOverrides);
|
|
492
|
-
|
|
493
|
-
return new runtime.VoidApiResponse(response);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Current calendar-month spend, plan cap, soft warning tier, and breakdowns by action and model tier. Dashboard polls this for the budget meter; 60s edge-cached via Redis is reasonable but not enforced server-side (lightweight aggregate).
|
|
498
|
-
* Per-account Zyphr Muse usage + budget tier
|
|
499
|
-
*/
|
|
500
|
-
async v1MuseUsageGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
501
|
-
await this.v1MuseUsageGetRaw(initOverrides);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Streams Opus tokens then emits a fully-validated workflow JSON object (single root, no cycles, branch_path coherent, all step types valid). Channels referenced by the workflow must appear in the project\'s available_channels grounding; unsupported channels fall back to email via the prompt\'s hard rules.
|
|
506
|
-
* Stream a generated workflow from a natural-language description
|
|
507
|
-
*/
|
|
508
|
-
async v1MuseWorkflowsGeneratePostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
509
|
-
const queryParameters: any = {};
|
|
510
|
-
|
|
511
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
512
|
-
|
|
513
|
-
const response = await this.request({
|
|
514
|
-
path: `/v1/muse/workflows/generate`,
|
|
515
|
-
method: 'POST',
|
|
516
|
-
headers: headerParameters,
|
|
517
|
-
query: queryParameters,
|
|
518
|
-
}, initOverrides);
|
|
519
|
-
|
|
520
|
-
return new runtime.VoidApiResponse(response);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Streams Opus tokens then emits a fully-validated workflow JSON object (single root, no cycles, branch_path coherent, all step types valid). Channels referenced by the workflow must appear in the project\'s available_channels grounding; unsupported channels fall back to email via the prompt\'s hard rules.
|
|
525
|
-
* Stream a generated workflow from a natural-language description
|
|
526
|
-
*/
|
|
527
|
-
async v1MuseWorkflowsGeneratePost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
528
|
-
await this.v1MuseWorkflowsGeneratePostRaw(initOverrides);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Zyphr API
|
|
5
|
-
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.0.0
|
|
8
|
-
* Contact: support@zyphr.dev
|
|
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
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @export
|
|
19
|
-
* @interface V1MuseSubjectsSuggestPostRequest
|
|
20
|
-
*/
|
|
21
|
-
export interface V1MuseSubjectsSuggestPostRequest {
|
|
22
|
-
/**
|
|
23
|
-
* Optional template id. When provided, the route resolves the
|
|
24
|
-
* template body server-side. Cannot be combined with template_body.
|
|
25
|
-
* @type {string}
|
|
26
|
-
* @memberof V1MuseSubjectsSuggestPostRequest
|
|
27
|
-
*/
|
|
28
|
-
templateId?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Optional raw template body. Empty/missing is allowed —
|
|
31
|
-
* the prompt handles sparse input by falling back to channel
|
|
32
|
-
* best-practices.
|
|
33
|
-
* @type {string}
|
|
34
|
-
* @memberof V1MuseSubjectsSuggestPostRequest
|
|
35
|
-
*/
|
|
36
|
-
templateBody?: string;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @type {string}
|
|
40
|
-
* @memberof V1MuseSubjectsSuggestPostRequest
|
|
41
|
-
*/
|
|
42
|
-
channel: V1MuseSubjectsSuggestPostRequestChannelEnum;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @type {string}
|
|
46
|
-
* @memberof V1MuseSubjectsSuggestPostRequest
|
|
47
|
-
*/
|
|
48
|
-
projectId: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @export
|
|
54
|
-
*/
|
|
55
|
-
export const V1MuseSubjectsSuggestPostRequestChannelEnum = {
|
|
56
|
-
EMAIL: 'email',
|
|
57
|
-
PUSH: 'push'
|
|
58
|
-
} as const;
|
|
59
|
-
export type V1MuseSubjectsSuggestPostRequestChannelEnum = typeof V1MuseSubjectsSuggestPostRequestChannelEnum[keyof typeof V1MuseSubjectsSuggestPostRequestChannelEnum];
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Check if a given object implements the V1MuseSubjectsSuggestPostRequest interface.
|
|
64
|
-
*/
|
|
65
|
-
export function instanceOfV1MuseSubjectsSuggestPostRequest(value: object): value is V1MuseSubjectsSuggestPostRequest {
|
|
66
|
-
if (!('channel' in value) || value['channel'] === undefined) return false;
|
|
67
|
-
if (!('projectId' in value) || value['projectId'] === undefined) return false;
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function V1MuseSubjectsSuggestPostRequestFromJSON(json: any): V1MuseSubjectsSuggestPostRequest {
|
|
72
|
-
return V1MuseSubjectsSuggestPostRequestFromJSONTyped(json, false);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function V1MuseSubjectsSuggestPostRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): V1MuseSubjectsSuggestPostRequest {
|
|
76
|
-
if (json == null) {
|
|
77
|
-
return json;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
|
|
81
|
-
'templateId': json['template_id'] == null ? undefined : json['template_id'],
|
|
82
|
-
'templateBody': json['template_body'] == null ? undefined : json['template_body'],
|
|
83
|
-
'channel': json['channel'],
|
|
84
|
-
'projectId': json['project_id'],
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function V1MuseSubjectsSuggestPostRequestToJSON(json: any): V1MuseSubjectsSuggestPostRequest {
|
|
89
|
-
return V1MuseSubjectsSuggestPostRequestToJSONTyped(json, false);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function V1MuseSubjectsSuggestPostRequestToJSONTyped(value?: V1MuseSubjectsSuggestPostRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
93
|
-
if (value == null) {
|
|
94
|
-
return value;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
|
|
99
|
-
'template_id': value['templateId'],
|
|
100
|
-
'template_body': value['templateBody'],
|
|
101
|
-
'channel': value['channel'],
|
|
102
|
-
'project_id': value['projectId'],
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|