@isnap/sdk 1.3.0-next.99 → 1.4.0-next.203
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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/client.d.ts +14 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -3
- package/dist/client.js.map +1 -1
- package/dist/generated/openapi.d.ts +2474 -937
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/apps.d.ts +31 -0
- package/dist/resources/apps.d.ts.map +1 -0
- package/dist/resources/apps.js +29 -0
- package/dist/resources/apps.js.map +1 -0
- package/dist/resources/lines.d.ts +206 -6
- package/dist/resources/lines.d.ts.map +1 -1
- package/dist/resources/lines.js +215 -6
- package/dist/resources/lines.js.map +1 -1
- package/dist/resources/macos-sessions.d.ts +48 -0
- package/dist/resources/macos-sessions.d.ts.map +1 -0
- package/dist/resources/macos-sessions.js +51 -0
- package/dist/resources/macos-sessions.js.map +1 -0
- package/dist/resources/preorders.d.ts +31 -8
- package/dist/resources/preorders.d.ts.map +1 -1
- package/dist/resources/preorders.js +31 -8
- package/dist/resources/preorders.js.map +1 -1
- package/dist/resources/webhooks.d.ts +1 -1
- package/dist/resources/webhooks.js +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +13 -5
- package/dist/version.js.map +1 -1
- package/dist/webhooks/types.d.ts +46 -3
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/webhooks/types.js +3 -0
- package/dist/webhooks/types.js.map +1 -1
- package/dist/webhooks/verify.d.ts +22 -9
- package/dist/webhooks/verify.d.ts.map +1 -1
- package/dist/webhooks/verify.js +101 -29
- package/dist/webhooks/verify.js.map +1 -1
- package/package.json +1 -1
package/dist/resources/lines.js
CHANGED
|
@@ -54,10 +54,18 @@ export class LinesResource extends BaseResource {
|
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* `POST /v1/lines/{id}/activate` — commit a reserved line to `active`.
|
|
57
|
-
* Wholesale partners
|
|
58
|
-
* Stripe checkout, EOM-metered)
|
|
59
|
-
* via `body.inbound_only`. Direct
|
|
60
|
-
*
|
|
57
|
+
* **Wholesale partners only**: the second phase of reserve→activate (no
|
|
58
|
+
* Stripe checkout, EOM-metered), which may pick the inbound-only rental
|
|
59
|
+
* variant via `body.inbound_only`. Direct customers get `402
|
|
60
|
+
* checkout_required` — their line activates when the Stripe Checkout session
|
|
61
|
+
* from `billing.checkout()` is paid, and their `inbound_only` comes from the
|
|
62
|
+
* price they paid.
|
|
63
|
+
*
|
|
64
|
+
* `body.billing_anchor_at` states the date the customer who pays for this
|
|
65
|
+
* line is billed on — every line that customer holds then moves together: one
|
|
66
|
+
* full month at each occurrence, with a credit at the first occurrence for
|
|
67
|
+
* the days the activation month had already paid for past it. Omit it and the
|
|
68
|
+
* line is billed on its activation instant.
|
|
61
69
|
*/
|
|
62
70
|
activate(id, body = {}, opts) {
|
|
63
71
|
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/activate`, body, opts);
|
|
@@ -66,6 +74,100 @@ export class LinesResource extends BaseResource {
|
|
|
66
74
|
release(id, opts) {
|
|
67
75
|
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/release`, undefined, opts);
|
|
68
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* `POST /v1/lines/{id}/terminate` — permanently END a line you own. The
|
|
79
|
+
* self-serve counterpart to the admin terminate, and the verb to call when
|
|
80
|
+
* your own customer cancels: `release()` only returns a *reserved*
|
|
81
|
+
* marketplace line to the shelf, while this ends a live `rental` line or a
|
|
82
|
+
* virtual `shared` line for good.
|
|
83
|
+
*
|
|
84
|
+
* The line comes back at the terminal `cancelled` status, keeping its owner.
|
|
85
|
+
* Queued messages fail, shared-fleet bindings release, device sessions are
|
|
86
|
+
* revoked, and `line.disconnected` fires with `reason: "customer_initiated"`.
|
|
87
|
+
* Billing stops in both shapes — a per-line Stripe subscription is cancelled
|
|
88
|
+
* immediately, and a wholesale partner's end-of-month active-line count drops
|
|
89
|
+
* the line in the same breath.
|
|
90
|
+
*
|
|
91
|
+
* **Idempotent.** Terminating an already-terminated line resolves with the
|
|
92
|
+
* unchanged line (200), never a `ConflictError` — so a retry after a timeout
|
|
93
|
+
* is always safe and no `opts.idempotencyKey` is needed for it.
|
|
94
|
+
*
|
|
95
|
+
* Refusals: `BadRequestError` (400 `byod_not_customer_terminable`) — a BYOD
|
|
96
|
+
* line is your own hardware, billed per device slot by `/v1/byod/*`;
|
|
97
|
+
* `PermissionDeniedError` (403 `pool_line_not_terminable`) — an owned test
|
|
98
|
+
* line must go through `convertFromTest()` first; `NotFoundError` (404) — a
|
|
99
|
+
* line that does not exist, or one you do not own (the same code for both, so
|
|
100
|
+
* nothing leaks).
|
|
101
|
+
*
|
|
102
|
+
* `body` defaults to `{}` (not `undefined`) so the request always carries
|
|
103
|
+
* `Content-Type: application/json`; the route's body is optional and the
|
|
104
|
+
* handler treats a missing body as `{}`.
|
|
105
|
+
*/
|
|
106
|
+
terminate(id, body = {}, opts) {
|
|
107
|
+
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/terminate`, body, opts);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `POST /v1/lines/{id}/cancel` — schedule the END of a line you own for its
|
|
111
|
+
* next billing anniversary, and keep using it until then.
|
|
112
|
+
*
|
|
113
|
+
* This is the verb for "my own customer cancelled". The month is already paid
|
|
114
|
+
* for and iSnap never prorates, so `terminate()` — which ends the line on the
|
|
115
|
+
* spot — throws away days you have bought. The line stays fully `active` and
|
|
116
|
+
* bills exactly as before; iSnap ends it itself when `cancel_at` arrives and
|
|
117
|
+
* fires `line.terminated` with `origin: "scheduled_cancellation"`.
|
|
118
|
+
*
|
|
119
|
+
* The resolved line carries `cancel_at`: the next occurrence of its
|
|
120
|
+
* `anniversary_at` strictly after now, clamped to the last day of a shorter
|
|
121
|
+
* month (a line taken on the 31st renews on the 28th in February and on the
|
|
122
|
+
* 31st again in March — the clamp never sticks).
|
|
123
|
+
*
|
|
124
|
+
* **Idempotent, and in the way that matters here.** Cancelling an
|
|
125
|
+
* already-cancelled line resolves with the SAME `cancel_at`, never a
|
|
126
|
+
* recomputed one — so a retry that happens to land after the stored date has
|
|
127
|
+
* passed cannot push your own cancellation a month into the future.
|
|
128
|
+
*
|
|
129
|
+
* Refusals: `ConflictError` (409 `line_has_no_anniversary`) — the line has no
|
|
130
|
+
* anniversary to cancel at; state it with `setAnniversary()`, or end the line
|
|
131
|
+
* now with `terminate()`. `ConflictError` (409
|
|
132
|
+
* `line_not_customer_cancellable`) — only an `active` or `suspended` line can
|
|
133
|
+
* be cancelled. `BadRequestError` (400 `byod_not_customer_cancellable`) and
|
|
134
|
+
* `PermissionDeniedError` (403 `pool_line_not_cancellable`) — those tiers have
|
|
135
|
+
* no per-line anniversary. `NotFoundError` (404) — a line that does not exist,
|
|
136
|
+
* or one you do not own (the same code for both, so nothing leaks).
|
|
137
|
+
*/
|
|
138
|
+
cancel(id, opts) {
|
|
139
|
+
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/cancel`, undefined, opts);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* `POST /v1/lines/{id}/uncancel` — undo a scheduled cancellation. `cancel_at`
|
|
143
|
+
* goes back to `null` and the line resumes renewing at its anniversary.
|
|
144
|
+
*
|
|
145
|
+
* **A no-op on a line that is not cancelled**: resolves 200 with the line and
|
|
146
|
+
* `cancel_at: null`, never an error — so a reconciliation loop that asserts
|
|
147
|
+
* "this line must not be cancelled" can run unconditionally.
|
|
148
|
+
*
|
|
149
|
+
* Refusal: `ConflictError` (409 `line_already_terminated`) once the
|
|
150
|
+
* anniversary has passed and iSnap has ended the line. That cannot be undone.
|
|
151
|
+
*/
|
|
152
|
+
uncancel(id, opts) {
|
|
153
|
+
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/uncancel`, undefined, opts);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* `POST /v1/lines/{id}/anniversary` — state the instant you took this line,
|
|
157
|
+
* which becomes the day of the month it renews on and the date `cancel()`
|
|
158
|
+
* waits for.
|
|
159
|
+
*
|
|
160
|
+
* **For lines migrated from your own system**, whose real start date iSnap
|
|
161
|
+
* cannot know. A line taken through the iSnap API is stamped automatically at
|
|
162
|
+
* activation and needs no call.
|
|
163
|
+
*
|
|
164
|
+
* Refusal: `ConflictError` (409 `line_cancellation_pending`) while a
|
|
165
|
+
* cancellation is scheduled — that `cancel_at` was computed from the
|
|
166
|
+
* anniversary you are replacing, so uncancel, set the date, and cancel again.
|
|
167
|
+
*/
|
|
168
|
+
setAnniversary(id, body, opts) {
|
|
169
|
+
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/anniversary`, body, opts);
|
|
170
|
+
}
|
|
69
171
|
/**
|
|
70
172
|
* `POST /v1/lines/{id}/transfer-ownership` — reassign a line to a
|
|
71
173
|
* different end-user account without re-pairing the underlying device.
|
|
@@ -92,8 +194,115 @@ export class LinesResource extends BaseResource {
|
|
|
92
194
|
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/convert-from-test`, undefined, opts);
|
|
93
195
|
}
|
|
94
196
|
/**
|
|
95
|
-
* `
|
|
96
|
-
*
|
|
197
|
+
* `POST /v1/lines/{id}/variant` — move a rental line you own between the
|
|
198
|
+
* INBOUND product (`inbound_only: true`) and the TWO-WAY product, **keeping
|
|
199
|
+
* the same phone number**, the same hardware and the same device session.
|
|
200
|
+
*
|
|
201
|
+
* `inbound_only` is not "receive-only": the line converses normally, it
|
|
202
|
+
* simply cannot OPEN a conversation. It may message only a handle that has
|
|
203
|
+
* messaged it first, and once that handle has, the exchange is unrestricted
|
|
204
|
+
* in both directions for good. A send that breaks the rule is a
|
|
205
|
+
* `PermissionDeniedError` (403 `outbound_first_forbidden`).
|
|
206
|
+
*
|
|
207
|
+
* **Idempotent on the value.** Asking for the variant the line already has
|
|
208
|
+
* resolves with the line and writes nothing — no audit row, no
|
|
209
|
+
* `line.variant_changed` event — so a retry after a timeout is safe and is
|
|
210
|
+
* not a second change. It is not a toggle: state the value you want.
|
|
211
|
+
*
|
|
212
|
+
* `body.effective` says WHEN, and defaults to `'now'` — the only behaviour
|
|
213
|
+
* before the field existed, so an existing call is unchanged.
|
|
214
|
+
*
|
|
215
|
+
* - `'now'`: as above. Use it for an UPGRADE, which the customer has just
|
|
216
|
+
* paid for and which must apply to the very next send.
|
|
217
|
+
* - `'next_anchor'`: store the change against the line's next billing
|
|
218
|
+
* anchor. Nothing moves today — `inbound_only` keeps its current value and
|
|
219
|
+
* the line keeps serving the product it is being billed for — and the
|
|
220
|
+
* resolved line carries `pending_variant: { inbound_only, effective_at }`.
|
|
221
|
+
* Use it for a DOWNGRADE, so the customer keeps the two-way product
|
|
222
|
+
* through the month they have already bought. iSnap applies it at the
|
|
223
|
+
* anchor and fires `line.variant_changed` with `data.scheduled: true`;
|
|
224
|
+
* cancel it beforehand with {@link LinesResource.cancelVariantChange}.
|
|
225
|
+
*
|
|
226
|
+
* `body.not_before` (ISO instant, `'next_anchor'` only, defaults to now) is
|
|
227
|
+
* the earliest instant the change may take effect. iSnap resolves it to the
|
|
228
|
+
* FIRST anchor occurrence at or after it, applying the anchor's own
|
|
229
|
+
* day-of-month clamp — so state your customer's paid-period end and let
|
|
230
|
+
* iSnap pick the occurrence rather than computing one yourself. A monthly
|
|
231
|
+
* customer needs nothing here; a QUARTERLY or ANNUAL customer does, because
|
|
232
|
+
* without it the change would land on the next anchor and take back
|
|
233
|
+
* capability they have already paid for. The resolved instant comes back as
|
|
234
|
+
* `pending_variant.effective_at`. An instant in the past is a
|
|
235
|
+
* `BadRequestError` (400 `not_before_in_the_past`) — it is refused rather
|
|
236
|
+
* than clamped, because for a long-period customer the silent repair and the
|
|
237
|
+
* correct answer differ by months of the product they bought.
|
|
238
|
+
*
|
|
239
|
+
* Scheduling is idempotent on the PENDING value the same way an immediate
|
|
240
|
+
* change is on the live one: re-scheduling the change already pending
|
|
241
|
+
* resolves with the line and the date it was already given, and writes
|
|
242
|
+
* nothing. A DIFFERENT pending change is a `ConflictError` (409
|
|
243
|
+
* `variant_change_already_pending`) — cancel it first, because there is no
|
|
244
|
+
* honest way to merge two answers to "what is this line at the anchor".
|
|
245
|
+
*
|
|
246
|
+
* **A scheduled call can legitimately resolve with `pending_variant: null`,
|
|
247
|
+
* and that is not a failure.** Scheduling the variant the line ALREADY
|
|
248
|
+
* carries writes nothing, because nothing is pending — the line will still
|
|
249
|
+
* be on that variant at the anchor. Do not retry it. Tell it apart from a
|
|
250
|
+
* silently-dropped `effective` (see the deploy-order warning below) by
|
|
251
|
+
* reading the top-level `inbound_only`: equal to what you asked for means
|
|
252
|
+
* already-at-target; different means the field never reached the server and
|
|
253
|
+
* the change was applied immediately.
|
|
254
|
+
*
|
|
255
|
+
* ⚠️ **Adopt `effective` and `not_before` only against a deployment that has
|
|
256
|
+
* them.** iSnap STRIPS unknown request properties rather than rejecting
|
|
257
|
+
* them, so an early call gets no 400 — it gets the field dropped and an
|
|
258
|
+
* ordinary immediate flip, applying a downgrade on the spot. Check
|
|
259
|
+
* `client.version()` before sending either field.
|
|
260
|
+
*
|
|
261
|
+
* An immediate change does NOT cancel a scheduled one: they are separate
|
|
262
|
+
* acts, and a partner who needs an urgent upgrade must not have their
|
|
263
|
+
* standing downgrade withdrawn by it. Use `cancelVariantChange` for that.
|
|
264
|
+
*
|
|
265
|
+
* Refusals: `ConflictError` (409) — `not_a_rental_line` (byod / pool /
|
|
266
|
+
* shared have no variant), `line_not_active` (the line must be in service),
|
|
267
|
+
* `variant_bound_to_stripe_price` (the line carries an iSnap Stripe
|
|
268
|
+
* subscription, whose price IS its variant; change the subscription
|
|
269
|
+
* instead). A line the caller does not own is a masked `NotFoundError`
|
|
270
|
+
* (404), like every other per-line verb.
|
|
271
|
+
*/
|
|
272
|
+
setVariant(id, body, opts) {
|
|
273
|
+
return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/variant`, body, opts);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* `DELETE /v1/lines/{id}/variant` — call off the variant change scheduled
|
|
277
|
+
* for this line's next billing anchor.
|
|
278
|
+
*
|
|
279
|
+
* The line's live `inbound_only` is never touched: the scheduling did not
|
|
280
|
+
* move it either, so the only effect is that `pending_variant` becomes
|
|
281
|
+
* `null` and nothing happens at the anchor.
|
|
282
|
+
*
|
|
283
|
+
* A line with no pending change is a `NotFoundError` (404
|
|
284
|
+
* `no_pending_variant_change`), which includes a change the anchor has
|
|
285
|
+
* already applied — there is nothing left to cancel, and the line's own
|
|
286
|
+
* `inbound_only` now carries the answer. A change applied while this request
|
|
287
|
+
* was in flight is a `ConflictError` (409 `variant_change_already_applied`),
|
|
288
|
+
* so the two outcomes are distinguishable from the code alone.
|
|
289
|
+
*
|
|
290
|
+
* Succeeds on a suspended or cancelled line: withdrawing an instruction must
|
|
291
|
+
* never be blocked by the state that made it moot.
|
|
292
|
+
*/
|
|
293
|
+
cancelVariantChange(id, opts) {
|
|
294
|
+
return this.client.request('DELETE', `/v1/lines/${encodeURIComponent(id)}/variant`, undefined, opts);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* `PATCH /v1/lines/{id}` — update the line's free-form metadata object, its
|
|
298
|
+
* billing anchor, or both.
|
|
299
|
+
*
|
|
300
|
+
* `metadata` is a MERGE: null-valued keys delete those keys from the stored
|
|
301
|
+
* object. `billing_anchor_at` is the date the customer who pays for this line
|
|
302
|
+
* is billed on — a change takes effect at the NEXT occurrence and never
|
|
303
|
+
* rewrites a period already billed, and `null` clears it so the line falls
|
|
304
|
+
* back to its activation instant. Send at least one of the two; a body that
|
|
305
|
+
* states neither is refused with `no_fields_to_patch`.
|
|
97
306
|
*/
|
|
98
307
|
patch(id, body, opts) {
|
|
99
308
|
return this.client.request('PATCH', `/v1/lines/${encodeURIComponent(id)}`, body, opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAwBxC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACH,IAAI,CAAC,QAAwB,EAAE,EAAE,IAAqB;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAW,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE;YAClE,GAAG,IAAI;YACP,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;SACpC,CAAC,CAAA;IACJ,CAAC;IAED,uEAAuE;IACvE,QAAQ,CAAC,IAAqB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAU,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;IAC7E,CAAC;IAED,qFAAqF;IACrF,GAAG,CAAC,EAAU,EAAE,IAAqB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO,KAAK,EAAE,aAAa,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;IACjG,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAoB,EAAE,IAAqB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAC1E,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,CAAC,OAA2B,EAAE,EAAE,IAAqB;QAC7D,OAAO,IAAI,CAAC,MAAM,CAA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CAAC,OAAO,CACxB,KAAK,EACL,aAAa,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC5C,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,EAAU,EACV,IAAqB,EACrB,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,OAAO,EACP,aAAa,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC5C,IAAI,EACJ,IAAI,CACL,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { components } from '../generated/openapi.js';
|
|
2
|
+
import type { RequestOptions } from '../types.js';
|
|
3
|
+
import { BaseResource } from './base.js';
|
|
4
|
+
export type MacosSession = components['schemas']['MacosSession'];
|
|
5
|
+
/**
|
|
6
|
+
* Hosted macOS sessions rented on a wholesale partner's account (contract §2.16).
|
|
7
|
+
*
|
|
8
|
+
* A session is a macOS environment the partner runs their own iPhone's bridge
|
|
9
|
+
* against, with their OWN Apple ID signed into it. It is NOT a line: it carries
|
|
10
|
+
* no number and originates no messages, so nothing here has a direction, a
|
|
11
|
+
* platform or a capability.
|
|
12
|
+
*
|
|
13
|
+
* Direct customers do not use this resource — they buy sessions through
|
|
14
|
+
* `POST /v1/billing/mac-checkout` and every method here answers `403
|
|
15
|
+
* not_a_wholesale_partner` for them.
|
|
16
|
+
*/
|
|
17
|
+
export declare class MacosSessionsResource extends BaseResource {
|
|
18
|
+
/**
|
|
19
|
+
* `POST /v1/macos-sessions/rent` — take one session out of iSnap stock.
|
|
20
|
+
*
|
|
21
|
+
* The tenancy starts immediately and `anniversary_at` is the day it was taken:
|
|
22
|
+
* that day of the month is what the session bills on, clamped to the last day
|
|
23
|
+
* of shorter months. Throws `ConflictError` (`409 no_macos_session_in_stock`)
|
|
24
|
+
* when no session is free — iSnap provisions one and attaches it, so the call
|
|
25
|
+
* does not need to be retried on a schedule.
|
|
26
|
+
*
|
|
27
|
+
* One call rents one session; rent three by calling three times.
|
|
28
|
+
*/
|
|
29
|
+
rent(opts?: RequestOptions): Promise<MacosSession>;
|
|
30
|
+
/**
|
|
31
|
+
* `POST /v1/macos-sessions/{id}/cancel` — end the tenancy at its next anniversary.
|
|
32
|
+
*
|
|
33
|
+
* The session stays usable and keeps billing until `cancel_at`, the next
|
|
34
|
+
* occurrence of `anniversary_at` strictly after the call. Idempotent: a second
|
|
35
|
+
* call returns the `cancel_at` the first one set rather than pushing it a
|
|
36
|
+
* month further out.
|
|
37
|
+
*/
|
|
38
|
+
cancel(id: string, opts?: RequestOptions): Promise<MacosSession>;
|
|
39
|
+
/**
|
|
40
|
+
* `POST /v1/macos-sessions/{id}/uncancel` — withdraw a pending cancellation.
|
|
41
|
+
*
|
|
42
|
+
* Clears `cancel_at` and leaves `anniversary_at` untouched, so the billing day
|
|
43
|
+
* does not move. Idempotent on a session that is not cancelled, and `404` once
|
|
44
|
+
* the release has already returned the session to stock.
|
|
45
|
+
*/
|
|
46
|
+
uncancel(id: string, opts?: RequestOptions): Promise<MacosSession>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=macos-sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"macos-sessions.d.ts","sourceRoot":"","sources":["../../src/resources/macos-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAA;AAEhE;;;;;;;;;;;GAWG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;IACrD;;;;;;;;;;OAUG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAIlD;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAShE;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAQnE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BaseResource } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hosted macOS sessions rented on a wholesale partner's account (contract §2.16).
|
|
4
|
+
*
|
|
5
|
+
* A session is a macOS environment the partner runs their own iPhone's bridge
|
|
6
|
+
* against, with their OWN Apple ID signed into it. It is NOT a line: it carries
|
|
7
|
+
* no number and originates no messages, so nothing here has a direction, a
|
|
8
|
+
* platform or a capability.
|
|
9
|
+
*
|
|
10
|
+
* Direct customers do not use this resource — they buy sessions through
|
|
11
|
+
* `POST /v1/billing/mac-checkout` and every method here answers `403
|
|
12
|
+
* not_a_wholesale_partner` for them.
|
|
13
|
+
*/
|
|
14
|
+
export class MacosSessionsResource extends BaseResource {
|
|
15
|
+
/**
|
|
16
|
+
* `POST /v1/macos-sessions/rent` — take one session out of iSnap stock.
|
|
17
|
+
*
|
|
18
|
+
* The tenancy starts immediately and `anniversary_at` is the day it was taken:
|
|
19
|
+
* that day of the month is what the session bills on, clamped to the last day
|
|
20
|
+
* of shorter months. Throws `ConflictError` (`409 no_macos_session_in_stock`)
|
|
21
|
+
* when no session is free — iSnap provisions one and attaches it, so the call
|
|
22
|
+
* does not need to be retried on a schedule.
|
|
23
|
+
*
|
|
24
|
+
* One call rents one session; rent three by calling three times.
|
|
25
|
+
*/
|
|
26
|
+
rent(opts) {
|
|
27
|
+
return this.client.request('POST', '/v1/macos-sessions/rent', undefined, opts);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `POST /v1/macos-sessions/{id}/cancel` — end the tenancy at its next anniversary.
|
|
31
|
+
*
|
|
32
|
+
* The session stays usable and keeps billing until `cancel_at`, the next
|
|
33
|
+
* occurrence of `anniversary_at` strictly after the call. Idempotent: a second
|
|
34
|
+
* call returns the `cancel_at` the first one set rather than pushing it a
|
|
35
|
+
* month further out.
|
|
36
|
+
*/
|
|
37
|
+
cancel(id, opts) {
|
|
38
|
+
return this.client.request('POST', `/v1/macos-sessions/${encodeURIComponent(id)}/cancel`, undefined, opts);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* `POST /v1/macos-sessions/{id}/uncancel` — withdraw a pending cancellation.
|
|
42
|
+
*
|
|
43
|
+
* Clears `cancel_at` and leaves `anniversary_at` untouched, so the billing day
|
|
44
|
+
* does not move. Idempotent on a session that is not cancelled, and `404` once
|
|
45
|
+
* the release has already returned the session to stock.
|
|
46
|
+
*/
|
|
47
|
+
uncancel(id, opts) {
|
|
48
|
+
return this.client.request('POST', `/v1/macos-sessions/${encodeURIComponent(id)}/uncancel`, undefined, opts);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=macos-sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"macos-sessions.js","sourceRoot":"","sources":["../../src/resources/macos-sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIxC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACrD;;;;;;;;;;OAUG;IACH,IAAI,CAAC,IAAqB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAe,MAAM,EAAE,yBAAyB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;IAC9F,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,IAAqB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EACrD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,EAAU,EAAE,IAAqB;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,WAAW,EACvD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;CACF"}
|
|
@@ -10,22 +10,45 @@ export declare class PreOrdersResource extends BaseResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* `POST /v1/pre-orders` — place a pre-order for a rental tier with no
|
|
12
12
|
* in-stock inventory. Set `inbound_only: true` to request the inbound-only
|
|
13
|
-
* rental variant.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* rental variant. `billing_tier` is optional and ORTHOGONAL to that plan —
|
|
14
|
+
* omitting it means `rental_iphone`, the only tier this flow mints, and
|
|
15
|
+
* `rental_iphone` covers BOTH rental products (`inbound_only` is what picks
|
|
16
|
+
* between them), so naming both is never a contradiction. When named it is
|
|
17
|
+
* answered rather than discarded (WHA-2949): `rental_android` is a
|
|
18
|
+
* `400 android_rental_not_purchasable` — no Android product exists in the
|
|
19
|
+
* Stripe catalogue — and a BYOD / virtual-shared / pool tier is a
|
|
20
|
+
* `400 tier_not_pre_orderable` whose message names the endpoint that
|
|
21
|
+
* acquires it instead. Returns a `draft` pre-order and NOTHING else: no
|
|
22
|
+
* line, no fulfillment task, no ops notification, no Stripe charge, and
|
|
23
|
+
* `stripe_client_secret` is always `null`. A draft costs nothing to place
|
|
24
|
+
* and binds nobody — call `confirm()` to engage the month and start
|
|
25
|
+
* procurement.
|
|
18
26
|
*/
|
|
19
27
|
create(body: CreatePreOrderBody, opts?: RequestOptions): Promise<PreOrder>;
|
|
20
28
|
/**
|
|
21
29
|
* `POST /v1/pre-orders/{id}/confirm` — confirm a `draft` pre-order. The
|
|
22
30
|
* binding step: engages the one-month commitment (full month, no proration)
|
|
23
31
|
* and triggers procurement (mints the provisioning line + fulfillment task,
|
|
24
|
-
* notifies ops
|
|
25
|
-
*
|
|
32
|
+
* notifies ops). Returns the pre-order in `provisioning`; ops procures the
|
|
33
|
+
* hardware and the partner is notified via the `pre_order.fulfilled` webhook
|
|
34
|
+
* when a matching line is ready. Direct customers get a Stripe
|
|
35
|
+
* `stripe_client_secret` to confirm the first-month charge; wholesale
|
|
36
|
+
* partners are billed EOM (no per-line Stripe sub). Only a draft can be
|
|
37
|
+
* confirmed.
|
|
26
38
|
*/
|
|
27
39
|
confirm(id: string, opts?: RequestOptions): Promise<PreOrder>;
|
|
28
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* `GET /v1/pre-orders` — returns ONE PAGE of the caller's pre-orders.
|
|
42
|
+
*
|
|
43
|
+
* The endpoint is cursor-paginated; this method is not. Unlike `messages.list` and `chats.list`,
|
|
44
|
+
* which return an `AsyncIterable` via `paginate()`, this hands back a single page plus `has_more`
|
|
45
|
+
* / `next_cursor` for the caller to drive. Saying only "cursor-paginated" was true of the ENDPOINT
|
|
46
|
+
* and false of the METHOD, and a partner reading the docstring alone writes a `for await` and gets
|
|
47
|
+
* a runtime `TypeError` — the same class of break §5.2 was corrected for (WHA-2278).
|
|
48
|
+
*
|
|
49
|
+
* Iterate it yourself by passing the returned `next_cursor` back in `query.cursor` until
|
|
50
|
+
* `has_more` is false.
|
|
51
|
+
*/
|
|
29
52
|
list(query?: ListPreOrdersQuery, opts?: RequestOptions): Promise<PreOrderListData>;
|
|
30
53
|
/** `GET /v1/pre-orders/{id}` — fetch a single pre-order by id. */
|
|
31
54
|
get(id: string, opts?: RequestOptions): Promise<PreOrder>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preorders.d.ts","sourceRoot":"","sources":["../../src/resources/preorders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,M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WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;AAEnG,qBAAa,iBAAkB,SAAQ,YAAY;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI1E;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAS7D;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,KAAK,GAAE,kBAAuB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOtF,kEAAkE;IAClE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IASzD;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;CAQ7D"}
|
|
@@ -3,11 +3,19 @@ export class PreOrdersResource extends BaseResource {
|
|
|
3
3
|
/**
|
|
4
4
|
* `POST /v1/pre-orders` — place a pre-order for a rental tier with no
|
|
5
5
|
* in-stock inventory. Set `inbound_only: true` to request the inbound-only
|
|
6
|
-
* rental variant.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* rental variant. `billing_tier` is optional and ORTHOGONAL to that plan —
|
|
7
|
+
* omitting it means `rental_iphone`, the only tier this flow mints, and
|
|
8
|
+
* `rental_iphone` covers BOTH rental products (`inbound_only` is what picks
|
|
9
|
+
* between them), so naming both is never a contradiction. When named it is
|
|
10
|
+
* answered rather than discarded (WHA-2949): `rental_android` is a
|
|
11
|
+
* `400 android_rental_not_purchasable` — no Android product exists in the
|
|
12
|
+
* Stripe catalogue — and a BYOD / virtual-shared / pool tier is a
|
|
13
|
+
* `400 tier_not_pre_orderable` whose message names the endpoint that
|
|
14
|
+
* acquires it instead. Returns a `draft` pre-order and NOTHING else: no
|
|
15
|
+
* line, no fulfillment task, no ops notification, no Stripe charge, and
|
|
16
|
+
* `stripe_client_secret` is always `null`. A draft costs nothing to place
|
|
17
|
+
* and binds nobody — call `confirm()` to engage the month and start
|
|
18
|
+
* procurement.
|
|
11
19
|
*/
|
|
12
20
|
create(body, opts) {
|
|
13
21
|
return this.client.request('POST', '/v1/pre-orders', body, opts);
|
|
@@ -16,13 +24,28 @@ export class PreOrdersResource extends BaseResource {
|
|
|
16
24
|
* `POST /v1/pre-orders/{id}/confirm` — confirm a `draft` pre-order. The
|
|
17
25
|
* binding step: engages the one-month commitment (full month, no proration)
|
|
18
26
|
* and triggers procurement (mints the provisioning line + fulfillment task,
|
|
19
|
-
* notifies ops
|
|
20
|
-
*
|
|
27
|
+
* notifies ops). Returns the pre-order in `provisioning`; ops procures the
|
|
28
|
+
* hardware and the partner is notified via the `pre_order.fulfilled` webhook
|
|
29
|
+
* when a matching line is ready. Direct customers get a Stripe
|
|
30
|
+
* `stripe_client_secret` to confirm the first-month charge; wholesale
|
|
31
|
+
* partners are billed EOM (no per-line Stripe sub). Only a draft can be
|
|
32
|
+
* confirmed.
|
|
21
33
|
*/
|
|
22
34
|
confirm(id, opts) {
|
|
23
35
|
return this.client.request('POST', `/v1/pre-orders/${encodeURIComponent(id)}/confirm`, undefined, opts);
|
|
24
36
|
}
|
|
25
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* `GET /v1/pre-orders` — returns ONE PAGE of the caller's pre-orders.
|
|
39
|
+
*
|
|
40
|
+
* The endpoint is cursor-paginated; this method is not. Unlike `messages.list` and `chats.list`,
|
|
41
|
+
* which return an `AsyncIterable` via `paginate()`, this hands back a single page plus `has_more`
|
|
42
|
+
* / `next_cursor` for the caller to drive. Saying only "cursor-paginated" was true of the ENDPOINT
|
|
43
|
+
* and false of the METHOD, and a partner reading the docstring alone writes a `for await` and gets
|
|
44
|
+
* a runtime `TypeError` — the same class of break §5.2 was corrected for (WHA-2278).
|
|
45
|
+
*
|
|
46
|
+
* Iterate it yourself by passing the returned `next_cursor` back in `query.cursor` until
|
|
47
|
+
* `has_more` is false.
|
|
48
|
+
*/
|
|
26
49
|
list(query = {}, opts) {
|
|
27
50
|
return this.client.request('GET', '/v1/pre-orders', undefined, {
|
|
28
51
|
...opts,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preorders.js","sourceRoot":"","sources":["../../src/resources/preorders.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"preorders.js","sourceRoot":"","sources":["../../src/resources/preorders.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAcxC,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAwB,EAAE,IAAqB;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAW,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAC5E,CAAC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAU,EAAE,IAAqB;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAClD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAA4B,EAAE,EAAE,IAAqB;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAmB,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE;YAC/E,GAAG,IAAI;YACP,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;SACpC,CAAC,CAAA;IACJ,CAAC;IAED,kEAAkE;IAClE,GAAG,CAAC,EAAU,EAAE,IAAqB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC1C,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,IAAqB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EACjD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;CACF"}
|
|
@@ -27,7 +27,7 @@ export declare class WebhooksResource extends BaseResource {
|
|
|
27
27
|
/** `DELETE /v1/webhooks/{id}` — delete a subscription. Returns 204. */
|
|
28
28
|
delete(id: string, opts?: RequestOptions): Promise<void>;
|
|
29
29
|
/**
|
|
30
|
-
* `POST /v1/webhooks/{id}/rotate-secret` — mint a new `
|
|
30
|
+
* `POST /v1/webhooks/{id}/rotate-secret` — mint a new `whsec_*` secret.
|
|
31
31
|
* Old secret stays valid for 5 minutes (`old_secret_expires_at`) so the
|
|
32
32
|
* caller can roll their verification code without dropping events.
|
|
33
33
|
* Plaintext secret is returned ONCE.
|
|
@@ -26,7 +26,7 @@ export class WebhooksResource extends BaseResource {
|
|
|
26
26
|
return this.client.request('DELETE', `/v1/webhooks/${encodeURIComponent(id)}`, undefined, opts);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* `POST /v1/webhooks/{id}/rotate-secret` — mint a new `
|
|
29
|
+
* `POST /v1/webhooks/{id}/rotate-secret` — mint a new `whsec_*` secret.
|
|
30
30
|
* Old secret stays valid for 5 minutes (`old_secret_expires_at`) so the
|
|
31
31
|
* caller can roll their verification code without dropping events.
|
|
32
32
|
* Plaintext secret is returned ONCE.
|
package/dist/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
2
|
-
export declare const MIN_API_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "1.4.0";
|
|
2
|
+
export declare const MIN_API_VERSION = "2.0.0";
|
|
3
3
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,UAAU,CAAA;AAyBlC,eAAO,MAAM,eAAe,UAAU,CAAA"}
|
package/dist/version.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// contract surface. Hand-maintained: no build or publish step derives this
|
|
5
5
|
// from `package.json`, so it MUST be bumped in the same commit as the
|
|
6
6
|
// `version` field there. `src/version.test.ts` fails CI when they disagree.
|
|
7
|
-
export const SDK_VERSION = '1.
|
|
7
|
+
export const SDK_VERSION = '1.4.0';
|
|
8
8
|
// Minimum API version the SDK considers compatible. Reference-only
|
|
9
9
|
// today: the client exposes `client.version()` to read `/v1/version` on
|
|
10
10
|
// demand, but does NOT call it automatically at first request as a
|
|
@@ -17,8 +17,16 @@ export const SDK_VERSION = '1.3.0';
|
|
|
17
17
|
// Bump this when the SDK starts using a feature that requires a specific
|
|
18
18
|
// backend version (e.g. a new endpoint added in API minor X.Y.0 — the
|
|
19
19
|
// SDK that wraps it sets MIN_API_VERSION to X.Y.0). Within a major
|
|
20
|
-
// version
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
|
|
20
|
+
// version, the API stays additive (oasdiff `--deprecation-days-stable 30`
|
|
21
|
+
// enforced in CI), so an SDK keeps working against any backend of the same
|
|
22
|
+
// major without raising the floor.
|
|
23
|
+
//
|
|
24
|
+
// WHA-2644 — raised from `1.0.0` to `2.0.0`. The premise the old value rested
|
|
25
|
+
// on ("within 1.x the API stays additive") is precisely what the pre-order
|
|
26
|
+
// strip broke: `PreOrder` lost `amount`, `billing_tier` and
|
|
27
|
+
// `stripe_payment_intent_id`, so the generated types in this package no longer
|
|
28
|
+
// describe ANY 1.x backend. Leaving the floor at `1.0.0` would have been the
|
|
29
|
+
// same class of defect the change removes — a field that says something the
|
|
30
|
+
// code does not do.
|
|
31
|
+
export const MIN_API_VERSION = '2.0.0';
|
|
24
32
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,yEAAyE;AACzE,wEAAwE;AACxE,2EAA2E;AAC3E,sEAAsE;AACtE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAA;AAElC,mEAAmE;AACnE,wEAAwE;AACxE,mEAAmE;AACnE,wEAAwE;AACxE,2EAA2E;AAC3E,gEAAgE;AAChE,uEAAuE;AACvE,oBAAoB;AACpB,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,mEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,yEAAyE;AACzE,wEAAwE;AACxE,2EAA2E;AAC3E,sEAAsE;AACtE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAA;AAElC,mEAAmE;AACnE,wEAAwE;AACxE,mEAAmE;AACnE,wEAAwE;AACxE,2EAA2E;AAC3E,gEAAgE;AAChE,uEAAuE;AACvE,oBAAoB;AACpB,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,mEAAmE;AACnE,0EAA0E;AAC1E,2EAA2E;AAC3E,mCAAmC;AACnC,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,4DAA4D;AAC5D,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAA"}
|