@zinn-digital/sdk 0.1.1451 → 0.1.1453

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.
@@ -20943,7 +20943,7 @@ export interface paths {
20943
20943
  post?: never;
20944
20944
  /**
20945
20945
  * Remove a site tag; its script answers 404 from then on.
20946
- * @description Gated on `ads.manage`; audit-logged (`ads.site_tag_deleted`).
20946
+ * @description Gated on `ads.manage`; audit-logged (`ads.site_tag_deleted`). A first-party setup (za-123) is removed first, as `DELETE …/first-party` does; a temporary Cloudflare failure refuses the delete (503) so nothing is left on the customer's account.
20947
20947
  */
20948
20948
  delete: operations["deleteAdsSiteTag"];
20949
20949
  options?: never;
@@ -20951,6 +20951,58 @@ export interface paths {
20951
20951
  patch?: never;
20952
20952
  trace?: never;
20953
20953
  };
20954
+ "/v1/ads/site-tags/{tag_id}/first-party": {
20955
+ parameters: {
20956
+ query?: never;
20957
+ header?: never;
20958
+ path: {
20959
+ tag_id: string;
20960
+ };
20961
+ cookie?: never;
20962
+ };
20963
+ /**
20964
+ * First-party tracking for this site on the customer's own Cloudflare (za-123).
20965
+ * @description Gated on `ads.view` (docs/1006 §105). `status` is `off` until a token is connected, then `ok`, `needs_token` (the customer must fix the token or zone) or `failed` (`last_error`). `snippet` is the first-party install: the universal script from `/ztag/{public_key}.js` on the site's own host. Never returns the token: `token_hint` is its last four characters.
20966
+ */
20967
+ get: operations["getAdsSiteTagFirstParty"];
20968
+ /**
20969
+ * Deploy first-party tracking with the customer's own Cloudflare API token.
20970
+ * @description Gated on `ads.manage`; audit-logged (`ads.first_party_connected`, zone and route only). The token (Zone Read, Workers Scripts Edit, Workers Routes Edit) is checked by using it: one Worker `zinn-ads-<id>` is uploaded to the account of the site's zone and routed on `<site_host>/ztag/*` only. It serves the site's universal script and passes Google's tag gateway through, so gtag.js and its hits are same-origin; Consent Mode v2 defaults are still set before any tag loads. No HTML, DNS or zone setting is changed. The token is kept only in Vault; sending a new one replaces it and destroys the old one. Refusals: `refusal.adsconnect.firstParty.*` (`badToken`, `tokenRejected`, `permissionMissing`, `zoneNotFound` 422; `rateLimited`, `unavailable`, `vaultUnavailable` 503).
20971
+ */
20972
+ put: operations["connectAdsSiteTagFirstParty"];
20973
+ post?: never;
20974
+ /**
20975
+ * Remove the first-party route, Worker and stored token.
20976
+ * @description Gated on `ads.manage`; audit-logged (`ads.first_party_removed`). `removed_at_edge` is false when the stored token no longer works: our record and token are gone, and the customer deletes the `zinn-ads-…` Worker in their Cloudflare dashboard. A temporary Cloudflare failure changes nothing (503) so the call can be retried. 204 when there was nothing to remove.
20977
+ */
20978
+ delete: operations["deleteAdsSiteTagFirstParty"];
20979
+ options?: never;
20980
+ head?: never;
20981
+ patch?: never;
20982
+ trace?: never;
20983
+ };
20984
+ "/v1/ads/site-tags/{tag_id}/first-party/check": {
20985
+ parameters: {
20986
+ query?: never;
20987
+ header?: never;
20988
+ path: {
20989
+ tag_id: string;
20990
+ };
20991
+ cookie?: never;
20992
+ };
20993
+ get?: never;
20994
+ put?: never;
20995
+ /**
20996
+ * Ask Cloudflare whether the first-party route still serves this site.
20997
+ * @description Gated on `ads.manage` (docs/1006 §105). Records `ok`, `failed` (`routeMissing`: the route was removed or repointed) or `needs_token`; a temporary Cloudflare failure keeps the previous status. The served script uses the first-party path only while `ok`.
20998
+ */
20999
+ post: operations["checkAdsSiteTagFirstParty"];
21000
+ delete?: never;
21001
+ options?: never;
21002
+ head?: never;
21003
+ patch?: never;
21004
+ trace?: never;
21005
+ };
20954
21006
  "/v1/ads/site-tags/{tag_id}/gtm-container": {
20955
21007
  parameters: {
20956
21008
  query?: never;
@@ -24124,7 +24176,7 @@ export interface paths {
24124
24176
  * Run one chat completion on an open model, paid from Zinn® AI credits.
24125
24177
  * @description Serverless AI inference for Zinn® AI Hosting plans (every AI Hosting plan grants `serverless_inference`). Runs in the request, on actual tokens, billed from the org's Zinn® AI credits: plan-included credits first spend here (this is an AI Hosting surface), then bought top-up credit. The platform's small daily included allowance never funds it, and a customer's own provider key is not used.
24126
24178
  *
24127
- * Gates, each before anything is sent or charged: the plan grants `serverless_inference` (else `422 FEATURE_NOT_INCLUDED`); the model is offered and priced (else `422`, `refusal.aiInference.unknownModel`); the org is in good standing (else `422 AI_NOT_IN_GOOD_STANDING`); credit is left (else `422 AI_CREDIT_REQUIRED`, `details[].can_buy`). An answer that stops at the caller's own `max_output_tokens` before it finishes (a reasoning model can spend a small cap thinking) answers `422` with `details[]` `{field: max_output_tokens, maximum}` and a `failure` of class `refused`, code `output_cap_reached` (`aiError.outputCapReached`): raise the cap and send it again. Any other failed model call answers `503` with a `failure` whose class is `our_fault` and names no supplier. Neither charges anything. At most 64 messages of 32,000 characters; `max_output_tokens` 1 to 4,096 (default 1,024). Requires `sites.create`.
24179
+ * Gates, each before anything is sent or charged: the plan grants `serverless_inference` (else `422 FEATURE_NOT_INCLUDED`); the model is offered and priced (else `422`, `refusal.aiInference.unknownModel`); the org is in good standing (else `422 AI_NOT_IN_GOOD_STANDING`); credit is left (else `422 AI_CREDIT_REQUIRED`, `details[].can_buy`). An answer that stops at the caller's own `max_output_tokens` before it finishes (a reasoning model can spend a small cap thinking) answers `422` with `details[]` `{field: max_output_tokens, maximum}` and a `failure` of class `refused`, code `output_cap_reached` (`aiError.outputCapReached`): raise the cap and send it again. Any other failed model call answers `503` with a `failure` whose class is `our_fault` and names no supplier. Neither charges anything. At most 64 messages of 32,000 characters; `max_output_tokens` 1 to 4,096 (default 2,048). A reasoning model's thinking is off unless `reasoning` is `true`; opted in, the thinking counts against `max_output_tokens` and every token is billed. Requires `sites.create`.
24128
24180
  */
24129
24181
  post: operations["createAiInferenceChat"];
24130
24182
  delete?: never;
@@ -67706,6 +67758,26 @@ export interface components {
67706
67758
  */
67707
67759
  org_id?: string;
67708
67760
  };
67761
+ AdsSiteTagFirstParty: {
67762
+ /** Format: date-time */
67763
+ checked_at?: string | null;
67764
+ /** @description An error code: tokenRejected, permissionMissing, zoneNotFound, rateLimited, unavailable or routeMissing; empty when ok. */
67765
+ last_error?: string;
67766
+ /** @description The path on the site host: /ztag. */
67767
+ path: string;
67768
+ provider?: string;
67769
+ route_pattern: string;
67770
+ script_name?: string;
67771
+ snippet: string;
67772
+ /** @enum {string} */
67773
+ status: "off" | "ok" | "needs_token" | "failed";
67774
+ /** @description The token's last four characters */
67775
+ token_hint?: string;
67776
+ zone_name?: string;
67777
+ };
67778
+ AdsSiteTagFirstPartyConnect: {
67779
+ token: string;
67780
+ };
67709
67781
  AdsSiteTagInstall: {
67710
67782
  conversion_example: string;
67711
67783
  data_layer_example: string;
@@ -70549,12 +70621,17 @@ export interface components {
70549
70621
  data: components["schemas"]["AiImageProviderAvailability"][];
70550
70622
  };
70551
70623
  AiInferenceChatRequest: {
70552
- /** @default 1024 */
70624
+ /** @default 2048 */
70553
70625
  max_output_tokens: number;
70554
70626
  messages: components["schemas"]["AiInferenceMessage"][];
70555
70627
  /** @description A model from `GET /v1/ai/inference/models`; empty means the default. */
70556
70628
  model?: string;
70557
70629
  org_id?: components["schemas"]["Uuid"];
70630
+ /**
70631
+ * @description Let a reasoning model think before it answers. Off by default, because the thinking is output tokens: opted in, it counts against `max_output_tokens` and is billed like the answer. Models that do not reason ignore it.
70632
+ * @default false
70633
+ */
70634
+ reasoning: boolean;
70558
70635
  };
70559
70636
  AiInferenceMessage: {
70560
70637
  content: string;
@@ -147058,6 +147135,124 @@ export interface operations {
147058
147135
  401: components["responses"]["Unauthorized"];
147059
147136
  403: components["responses"]["Forbidden"];
147060
147137
  404: components["responses"]["NotFound"];
147138
+ 503: components["responses"]["ServiceUnavailable"];
147139
+ };
147140
+ };
147141
+ getAdsSiteTagFirstParty: {
147142
+ parameters: {
147143
+ query?: never;
147144
+ header?: never;
147145
+ path: {
147146
+ tag_id: string;
147147
+ };
147148
+ cookie?: never;
147149
+ };
147150
+ requestBody?: never;
147151
+ responses: {
147152
+ /** @description The first-party setup. */
147153
+ 200: {
147154
+ headers: {
147155
+ [name: string]: unknown;
147156
+ };
147157
+ content: {
147158
+ "application/json": components["schemas"]["AdsSiteTagFirstParty"];
147159
+ };
147160
+ };
147161
+ 401: components["responses"]["Unauthorized"];
147162
+ 403: components["responses"]["Forbidden"];
147163
+ 404: components["responses"]["NotFound"];
147164
+ };
147165
+ };
147166
+ connectAdsSiteTagFirstParty: {
147167
+ parameters: {
147168
+ query?: never;
147169
+ header?: never;
147170
+ path: {
147171
+ tag_id: string;
147172
+ };
147173
+ cookie?: never;
147174
+ };
147175
+ requestBody: {
147176
+ content: {
147177
+ "application/json": components["schemas"]["AdsSiteTagFirstPartyConnect"];
147178
+ };
147179
+ };
147180
+ responses: {
147181
+ /** @description Deployed. */
147182
+ 200: {
147183
+ headers: {
147184
+ [name: string]: unknown;
147185
+ };
147186
+ content: {
147187
+ "application/json": components["schemas"]["AdsSiteTagFirstParty"];
147188
+ };
147189
+ };
147190
+ 401: components["responses"]["Unauthorized"];
147191
+ 403: components["responses"]["Forbidden"];
147192
+ 404: components["responses"]["NotFound"];
147193
+ 422: components["responses"]["UnprocessableEntity"];
147194
+ 503: components["responses"]["ServiceUnavailable"];
147195
+ };
147196
+ };
147197
+ deleteAdsSiteTagFirstParty: {
147198
+ parameters: {
147199
+ query?: never;
147200
+ header?: never;
147201
+ path: {
147202
+ tag_id: string;
147203
+ };
147204
+ cookie?: never;
147205
+ };
147206
+ requestBody?: never;
147207
+ responses: {
147208
+ /** @description Removed. */
147209
+ 200: {
147210
+ headers: {
147211
+ [name: string]: unknown;
147212
+ };
147213
+ content: {
147214
+ "application/json": {
147215
+ removed_at_edge: boolean;
147216
+ };
147217
+ };
147218
+ };
147219
+ /** @description Nothing to remove. */
147220
+ 204: {
147221
+ headers: {
147222
+ [name: string]: unknown;
147223
+ };
147224
+ content?: never;
147225
+ };
147226
+ 401: components["responses"]["Unauthorized"];
147227
+ 403: components["responses"]["Forbidden"];
147228
+ 404: components["responses"]["NotFound"];
147229
+ 503: components["responses"]["ServiceUnavailable"];
147230
+ };
147231
+ };
147232
+ checkAdsSiteTagFirstParty: {
147233
+ parameters: {
147234
+ query?: never;
147235
+ header?: never;
147236
+ path: {
147237
+ tag_id: string;
147238
+ };
147239
+ cookie?: never;
147240
+ };
147241
+ requestBody?: never;
147242
+ responses: {
147243
+ /** @description The first-party setup after the check. */
147244
+ 200: {
147245
+ headers: {
147246
+ [name: string]: unknown;
147247
+ };
147248
+ content: {
147249
+ "application/json": components["schemas"]["AdsSiteTagFirstParty"];
147250
+ };
147251
+ };
147252
+ 401: components["responses"]["Unauthorized"];
147253
+ 403: components["responses"]["Forbidden"];
147254
+ 404: components["responses"]["NotFound"];
147255
+ 503: components["responses"]["ServiceUnavailable"];
147061
147256
  };
147062
147257
  };
147063
147258
  getAdsSiteTagGtmContainer: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1451",
3
+ "version": "0.1.1453",
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>",