@zinn-digital/sdk 0.1.1640 → 0.1.1642

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.
@@ -56341,6 +56341,126 @@ export interface paths {
56341
56341
  patch?: never;
56342
56342
  trace?: never;
56343
56343
  };
56344
+ "/v1/store-connect/authorize": {
56345
+ parameters: {
56346
+ query?: never;
56347
+ header?: never;
56348
+ path?: never;
56349
+ cookie?: never;
56350
+ };
56351
+ get?: never;
56352
+ put?: never;
56353
+ /**
56354
+ * A member approves a store's Zinn® Order Updates connection (the consent screen's Allow).
56355
+ * @description docs/1297 §5. Needs `email_marketing.manage` in `org_id` (or the only org the member manages). Keeps a single-use grant for ten minutes holding the SHA-256 of a one-time `code` and the plugin's PKCE `code_challenge` (S256 only). ⛔ `return_url` must be the SAME ORIGIN as `site_url`; the dashboard sends the browser to `redirect_to` with `code` and the plugin's `state`. Audit action `store_connect.authorized`.
56356
+ */
56357
+ post: operations["authorizeStoreConnect"];
56358
+ delete?: never;
56359
+ options?: never;
56360
+ head?: never;
56361
+ patch?: never;
56362
+ trace?: never;
56363
+ };
56364
+ "/v1/store-connect/connection": {
56365
+ parameters: {
56366
+ query?: never;
56367
+ header?: never;
56368
+ path?: never;
56369
+ cookie?: never;
56370
+ };
56371
+ get?: never;
56372
+ put?: never;
56373
+ post?: never;
56374
+ /**
56375
+ * The store plugin's own Disconnect button revokes its token.
56376
+ * @description Store token only. Audit action `store_connect.disconnected` (by `plugin`).
56377
+ */
56378
+ delete: operations["disconnectStore"];
56379
+ options?: never;
56380
+ head?: never;
56381
+ patch?: never;
56382
+ trace?: never;
56383
+ };
56384
+ "/v1/store-connect/connections": {
56385
+ parameters: {
56386
+ query?: never;
56387
+ header?: never;
56388
+ path?: never;
56389
+ cookie?: never;
56390
+ };
56391
+ /**
56392
+ * Connected stores, newest first (Campaigns, Stores).
56393
+ * @description Needs `email_marketing.view`; only orgs where the member holds it. Keyset paged: follow `next_after` until it is null (a page size, never a cap).
56394
+ */
56395
+ get: operations["listStoreConnections"];
56396
+ put?: never;
56397
+ post?: never;
56398
+ delete?: never;
56399
+ options?: never;
56400
+ head?: never;
56401
+ patch?: never;
56402
+ trace?: never;
56403
+ };
56404
+ "/v1/store-connect/connections/{connection_id}": {
56405
+ parameters: {
56406
+ query?: never;
56407
+ header?: never;
56408
+ path?: never;
56409
+ cookie?: never;
56410
+ };
56411
+ get?: never;
56412
+ put?: never;
56413
+ post?: never;
56414
+ /**
56415
+ * Disconnect a store from the dashboard.
56416
+ * @description Needs `email_marketing.manage` in the store's org; another org's store is a 404. The store's token stops at once; the plugin shows Reconnect. Audit action `store_connect.disconnected` (by `dashboard`).
56417
+ */
56418
+ delete: operations["revokeStoreConnection"];
56419
+ options?: never;
56420
+ head?: never;
56421
+ patch?: never;
56422
+ trace?: never;
56423
+ };
56424
+ "/v1/store-connect/status": {
56425
+ parameters: {
56426
+ query?: never;
56427
+ header?: never;
56428
+ path?: never;
56429
+ cookie?: never;
56430
+ };
56431
+ /**
56432
+ * The store plugin reads its connection; doubles as the heartbeat.
56433
+ * @description Store token only (`Authorization: Bearer zou_…`). Records `last_seen_at` and the reported versions and integrations. Missing, wrong and revoked tokens are one answer (401).
56434
+ */
56435
+ get: operations["getStoreConnectStatus"];
56436
+ put?: never;
56437
+ post?: never;
56438
+ delete?: never;
56439
+ options?: never;
56440
+ head?: never;
56441
+ patch?: never;
56442
+ trace?: never;
56443
+ };
56444
+ "/v1/store-connect/token": {
56445
+ parameters: {
56446
+ query?: never;
56447
+ header?: never;
56448
+ path?: never;
56449
+ cookie?: never;
56450
+ };
56451
+ get?: never;
56452
+ put?: never;
56453
+ /**
56454
+ * The store plugin exchanges the one-time code and its PKCE verifier for a store token.
56455
+ * @description ⛔ **No session**: server to server from the store. The code is claimed with one conditional write before anything else is checked, so it works once; a wrong verifier or another site burns it. Unknown, used, expired and mismatched codes are one answer (422 `codeInvalid`). Re-connecting a store retires its old token in the same step. The `token` (`zou_…`) is returned ONCE; we keep its SHA-256. Audit action `store_connect.connected`.
56456
+ */
56457
+ post: operations["exchangeStoreConnectCode"];
56458
+ delete?: never;
56459
+ options?: never;
56460
+ head?: never;
56461
+ patch?: never;
56462
+ trace?: never;
56463
+ };
56344
56464
  "/v1/streaming/streams": {
56345
56465
  parameters: {
56346
56466
  query?: never;
@@ -56458,7 +56578,7 @@ export interface paths {
56458
56578
  *
56459
56579
  * ⛔⛔ **Switching to PayPal returns an `approval_url` and grants nothing.** Until the buyer approves in PayPal's own interface and PayPal sends us a **signed** `BILLING.SUBSCRIPTION.ACTIVATED` webhook, the agreement cannot charge and the subscription's clock has not started. `active` is `false` for exactly that reason. The browser's return from the approval URL is an attacker-supplied claim and is never treated as approval.
56460
56580
  *
56461
- * Switching **away** cancels the agreement at PayPal first and unbinds second. The reverse order would hand the subscription back to the engine's renewal sweep while PayPal was still entitled to charge it — a double charge for the window between the two calls.
56581
+ * Switching **away** cancels the agreement at PayPal first and unbinds second. The reverse order would hand the subscription back to the engine's renewal sweep while PayPal was still entitled to charge it — a double charge for the window between the two calls. A 404 from PayPal on that cancel is success when a re-read shows the agreement cannot charge (never approved, cancelled, expired or gone); otherwise the subscription stays on PayPal and the answer is `422 PAYPAL_REFUSED`. A PayPal timeout or 5xx is `503` with `PAYPAL_REFUSED` (billing unchanged, safe to retry). No PayPal answer is ever a `500`.
56462
56582
  *
56463
56583
  * Requires `billing.payment.manage`. `422` carries a `code`: `ALREADY_ON_RAIL`, `NO_CATALOGUE_PRICE`, `PRICE_WOULD_CHANGE` (the subscription is on a price that differs from the published one, so switching would change what the customer pays — refused rather than done quietly), `NOT_SWITCHABLE`, `PAYPAL_REFUSED`, or `RENEWAL_UNPAID` (pay first: a renewal of this subscription is unpaid, so the switch onto PayPal is refused before PayPal is called; pay it on the billing page, then switch).
56464
56584
  */
@@ -111002,6 +111122,43 @@ export interface components {
111002
111122
  /** @description GB beyond the allowance, or `0` — never negative. */
111003
111123
  over_allowance_gb?: number;
111004
111124
  };
111125
+ StoreConnectAuthorized: {
111126
+ /** @description zouc_… — single use, ten minutes. */
111127
+ code: string;
111128
+ /** Format: date-time */
111129
+ expires_at: string;
111130
+ /**
111131
+ * Format: uri
111132
+ * @description The plugin's return URL; add `code` and `state`.
111133
+ */
111134
+ redirect_to: string;
111135
+ site_host: string;
111136
+ };
111137
+ /** @description A store running Zinn® Order Updates, connected to an org (docs/1297 §4.4). Never the token. */
111138
+ StoreConnection: {
111139
+ /** Format: date-time */
111140
+ connected_at: string;
111141
+ connected_by: string;
111142
+ /** Format: uuid */
111143
+ id: string;
111144
+ integrations: string[];
111145
+ /** Format: date-time */
111146
+ last_seen_at: string | null;
111147
+ /** Format: uuid */
111148
+ org_id: string;
111149
+ plugin_version: string;
111150
+ site_host: string;
111151
+ site_url: string;
111152
+ /** @enum {string} */
111153
+ status: "active" | "revoked";
111154
+ /** @description The token's last four characters. */
111155
+ token_hint: string;
111156
+ wp_version: string;
111157
+ };
111158
+ StoreConnectStatus: components["schemas"]["StoreConnection"] & {
111159
+ /** @description Zinn® Campaigns is open for this org. */
111160
+ campaigns_open: boolean;
111161
+ };
111005
111162
  StoredVideo: {
111006
111163
  /** Format: date-time */
111007
111164
  created_at?: string | null;
@@ -209291,6 +209448,195 @@ export interface operations {
209291
209448
  429: components["responses"]["TooManyRequests"];
209292
209449
  };
209293
209450
  };
209451
+ authorizeStoreConnect: {
209452
+ parameters: {
209453
+ query?: never;
209454
+ header?: never;
209455
+ path?: never;
209456
+ cookie?: never;
209457
+ };
209458
+ requestBody: {
209459
+ content: {
209460
+ "application/json": {
209461
+ code_challenge: string;
209462
+ /**
209463
+ * @default S256
209464
+ * @enum {string}
209465
+ */
209466
+ code_challenge_method?: "S256";
209467
+ /** Format: uuid */
209468
+ org_id?: string;
209469
+ /**
209470
+ * Format: uri
209471
+ * @description The plugin's admin page
209472
+ */
209473
+ return_url: string;
209474
+ /**
209475
+ * Format: uri
209476
+ * @description The store's home_url().
209477
+ */
209478
+ site_url: string;
209479
+ };
209480
+ };
209481
+ };
209482
+ responses: {
209483
+ /** @description Approved. The code is shown once; only its hash is kept. */
209484
+ 201: {
209485
+ headers: {
209486
+ [name: string]: unknown;
209487
+ };
209488
+ content: {
209489
+ "application/json": components["schemas"]["StoreConnectAuthorized"];
209490
+ };
209491
+ };
209492
+ 401: components["responses"]["Unauthorized"];
209493
+ 403: components["responses"]["Forbidden"];
209494
+ 422: components["responses"]["UnprocessableEntity"];
209495
+ };
209496
+ };
209497
+ disconnectStore: {
209498
+ parameters: {
209499
+ query?: never;
209500
+ header?: never;
209501
+ path?: never;
209502
+ cookie?: never;
209503
+ };
209504
+ requestBody?: never;
209505
+ responses: {
209506
+ /** @description Disconnected. */
209507
+ 204: {
209508
+ headers: {
209509
+ [name: string]: unknown;
209510
+ };
209511
+ content?: never;
209512
+ };
209513
+ 401: components["responses"]["Unauthorized"];
209514
+ 429: components["responses"]["TooManyRequests"];
209515
+ };
209516
+ };
209517
+ listStoreConnections: {
209518
+ parameters: {
209519
+ query?: {
209520
+ after?: string;
209521
+ limit?: number;
209522
+ org_id?: string;
209523
+ };
209524
+ header?: never;
209525
+ path?: never;
209526
+ cookie?: never;
209527
+ };
209528
+ requestBody?: never;
209529
+ responses: {
209530
+ /** @description One page. */
209531
+ 200: {
209532
+ headers: {
209533
+ [name: string]: unknown;
209534
+ };
209535
+ content: {
209536
+ "application/json": {
209537
+ items: components["schemas"]["StoreConnection"][];
209538
+ /** Format: uuid */
209539
+ next_after: string | null;
209540
+ };
209541
+ };
209542
+ };
209543
+ 401: components["responses"]["Unauthorized"];
209544
+ 403: components["responses"]["Forbidden"];
209545
+ };
209546
+ };
209547
+ revokeStoreConnection: {
209548
+ parameters: {
209549
+ query?: never;
209550
+ header?: never;
209551
+ path: {
209552
+ connection_id: string;
209553
+ };
209554
+ cookie?: never;
209555
+ };
209556
+ requestBody?: never;
209557
+ responses: {
209558
+ /** @description Disconnected. */
209559
+ 204: {
209560
+ headers: {
209561
+ [name: string]: unknown;
209562
+ };
209563
+ content?: never;
209564
+ };
209565
+ 401: components["responses"]["Unauthorized"];
209566
+ 403: components["responses"]["Forbidden"];
209567
+ 404: components["responses"]["NotFound"];
209568
+ };
209569
+ };
209570
+ getStoreConnectStatus: {
209571
+ parameters: {
209572
+ query?: {
209573
+ /** @description Comma-separated integration keys. */
209574
+ integrations?: string;
209575
+ plugin_version?: string;
209576
+ wp_version?: string;
209577
+ };
209578
+ header?: never;
209579
+ path?: never;
209580
+ cookie?: never;
209581
+ };
209582
+ requestBody?: never;
209583
+ responses: {
209584
+ /** @description The connection. */
209585
+ 200: {
209586
+ headers: {
209587
+ [name: string]: unknown;
209588
+ };
209589
+ content: {
209590
+ "application/json": components["schemas"]["StoreConnectStatus"];
209591
+ };
209592
+ };
209593
+ 401: components["responses"]["Unauthorized"];
209594
+ 429: components["responses"]["TooManyRequests"];
209595
+ };
209596
+ };
209597
+ exchangeStoreConnectCode: {
209598
+ parameters: {
209599
+ query?: never;
209600
+ header?: never;
209601
+ path?: never;
209602
+ cookie?: never;
209603
+ };
209604
+ requestBody: {
209605
+ content: {
209606
+ "application/json": {
209607
+ code: string;
209608
+ code_verifier: string;
209609
+ integrations?: string[];
209610
+ /** @description Reported facts such as the WooCommerce version; scalars only. */
209611
+ platform?: {
209612
+ [key: string]: unknown;
209613
+ };
209614
+ plugin_version?: string;
209615
+ /** Format: uri */
209616
+ site_url: string;
209617
+ site_uuid?: string;
209618
+ wp_version?: string;
209619
+ };
209620
+ };
209621
+ };
209622
+ responses: {
209623
+ /** @description Connected. */
209624
+ 201: {
209625
+ headers: {
209626
+ [name: string]: unknown;
209627
+ };
209628
+ content: {
209629
+ "application/json": {
209630
+ connection: components["schemas"]["StoreConnectStatus"];
209631
+ /** @description zou_… — store it; it is never shown again. */
209632
+ token: string;
209633
+ };
209634
+ };
209635
+ };
209636
+ 422: components["responses"]["UnprocessableEntity"];
209637
+ 429: components["responses"]["TooManyRequests"];
209638
+ };
209639
+ };
209294
209640
  listLiveStreams: {
209295
209641
  parameters: {
209296
209642
  query?: never;
@@ -209446,6 +209792,7 @@ export interface operations {
209446
209792
  404: components["responses"]["NotFound"];
209447
209793
  422: components["responses"]["UnprocessableEntity"];
209448
209794
  429: components["responses"]["TooManyRequests"];
209795
+ 503: components["responses"]["ServiceUnavailable"];
209449
209796
  };
209450
209797
  };
209451
209798
  getSubscriptionCryptoAutoRenew: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1640",
3
+ "version": "0.1.1642",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",