@distilled.cloud/zendesk 1.0.0-rc.20 → 1.0.0-rc.22
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/README.md +0 -1
- package/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/credentials.d.ts +19 -8
- package/lib/credentials.d.ts.map +1 -1
- package/lib/errors.d.ts +7 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.lazy.js.map +1 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/protocol.d.ts +9 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/zendesk.d.ts +1111 -105
- package/lib/services/zendesk.d.ts.map +1 -1
- package/lib/services/zendesk.js +974 -952
- package/lib/services/zendesk.js.map +1 -1
- package/lib/services.lazy/zendesk.js +2 -2
- package/lib/traits.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/credentials.ts +43 -15
- package/src/errors.ts +9 -1
- package/src/protocol.ts +13 -23
- package/src/services/zendesk.ts +8731 -6021
package/README.md
CHANGED
package/lib/_bundle/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as a,errors$Forbidden as o,errors$GatewayTimeout as s,errors$HTTP_STATUS_MAP as c,errors$InternalServerError as
|
|
1
|
+
import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as a,errors$Forbidden as o,errors$GatewayTimeout as s,errors$HTTP_STATUS_MAP as c,errors$InternalServerError as ee,errors$Locked as te,errors$NotFound as ne,errors$ServiceUnavailable as re,errors$TooManyRequests as ie,errors$Unauthorized as ae,errors$UnknownErrorFields as oe,errors$UnprocessableEntity as se,protocol_http$originFromConfig as ce,protocol_rest$RawResponse as le,protocol_rest$RawResponseRoot as l,protocol_rest$SensitiveValue as u,protocol_rest$rawResponseRootSymbol as d,protocol_rest$rawResponseSymbol as f,protocol_rest$restProtocol as p,protocol_rest$sensitiveValueSymbol as m,protocol_rest$unknownErrorProps as h,schema_lite$Array as g,schema_lite$Boolean as _,schema_lite$NullOr as v,schema_lite$Number as y,schema_lite$Record as b,schema_lite$String as x,schema_lite$Struct as S,schema_lite$StructWithRest as C,schema_lite$TaggedError as w,schema_lite$Union as T,schema_lite$Unknown as E,schema_lite$at as D,schema_lite$optional as O,schema_lite$suspend as k}from"@distilled.cloud/core/_bundle/rest";import{api$D as A,api$call as j,api$error as M,api$named as N,api$newError as P,api$op as F,api$opPaginated as I,category$withAuthError as L,category$withBadRequestError as R,category$withConflictError as z,category$withParseError as B,pagination$paginateCursor as V,pagination$paginatePageNumber as H,retry$capped as U,retry$jittered as W,retry$makeDefault as ue,retry$throttlingFactory as G,retry$throttlingOptions as de,retry$transientFactory as K,retry$transientOptions as fe,schema_lite_typed$TaggedError as q,schema_lite_typed$Unknown as J,trait$Body as pe,trait$FormDataFile as me,trait$Header as he,trait$Http as ge,trait$HttpBody as _e,trait$KeyDictionary as ve,trait$Label as ye,trait$Query as be,trait$ResponseCode as xe,trait$UnionCases as Se,trait$applyErrorMatchers as Ce,trait$bodySymbol as we,trait$errorMatchersSymbol as Te,trait$formDataFileSymbol as Ee,trait$getErrorMatchers as De,trait$headerSymbol as Oe,trait$httpBodySymbol as ke,trait$httpSymbol as Ae,trait$keyDictionarySymbol as je,trait$labelSymbol as Me,trait$querySymbol as Ne,trait$responseCodeSymbol as Pe,trait$unionCasesSymbol as Fe}from"@distilled.cloud/core/_bundle/base";import*as Y from"effect/Context";import*as X from"effect/Effect";import*as Ie from"effect/encoding/Base64";import*as Z from"effect/Layer";import*as Q from"effect/Redacted";var Credentials=class extends (/*@__PURE__*/ Y.Service()(`ZendeskCredentials`)){};const stripTrailingSlash=e=>e.replace(/\/+$/,``);const originFromSubdomain=e=>{const t=e.trim().replace(/^https?:\/\//,``).replace(/\/+$/,``);if(t.includes(`.`))return`https://${t}`;return`https://${t}.zendesk.com`};const basicToken=(e,t)=>Q.make(`Basic ${Ie.encode(`${e}/token:${Q.value(t)}`)}`);const bearerToken=e=>Q.make(`Bearer ${Q.value(e)}`);const checkedOrigin=e=>{const t=ce(`Zendesk subdomain`,originFromSubdomain(e).slice(8));return typeof t===`string`?X.succeed(t):X.fail(t)};const resolveBaseUrl=e=>{if(e.apiBaseUrl)return X.succeed(stripTrailingSlash(e.apiBaseUrl));if(e.subdomain)return checkedOrigin(e.subdomain);return X.fail(new r({message:`Zendesk subdomain or apiBaseUrl is required`}))};const layer=e=>Z.effect(Credentials,X.map(e,e=>X.succeed(e)));const fromApiToken=e=>layer(X.map(resolveBaseUrl(e),t=>({authorization:basicToken(e.email,e.apiToken),apiBaseUrl:t})));const fromAccessToken=e=>layer(X.map(resolveBaseUrl(e),t=>({authorization:bearerToken(e.accessToken),apiBaseUrl:t})));const Le=/*@__PURE__*/ layer(/*@__PURE__*/ X.gen(function*(){const e=process.env.ZENDESK_SUBDOMAIN;const t=process.env.ZENDESK_API_BASE_URL;const n=process.env.ZENDESK_EMAIL;const i=process.env.ZENDESK_API_TOKEN;const a=i?Q.make(i):void 0;const o=process.env.ZENDESK_ACCESS_TOKEN;const s=o?Q.make(o):void 0;if(!e&&!t)return yield*new r({message:`ZENDESK_SUBDOMAIN (or ZENDESK_API_BASE_URL) environment variable is required`});const c=t?stripTrailingSlash(t):yield*checkedOrigin(e);if(s)return{authorization:bearerToken(s),apiBaseUrl:c};if(!n||!a)return yield*new r({message:`ZENDESK_EMAIL and ZENDESK_API_TOKEN (or ZENDESK_ACCESS_TOKEN) environment variables are required`});return{authorization:basicToken(n,a),apiBaseUrl:c}}));var UnknownZendeskError=class extends (/*@__PURE__*/ q()(`UnknownZendeskError`,oe)){};var ZendeskParseError=class extends (/*@__PURE__*/ q()(`ZendeskParseError`,{body:J,cause:J}).pipe(B)){};const $=e;const errorEnvelope=e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=typeof t.error===`string`?t.error:typeof t.code===`string`||typeof t.code===`number`?t.code:void 0;const r=typeof t.description===`string`?t.description:typeof t.message===`string`?t.message:typeof t.error===`string`?t.error:void 0;if(n===void 0&&r===void 0)return void 0;return{code:n,message:r}};const Re=/*@__PURE__*/ p({credentials:/*@__PURE__*/ X.flatten(Credentials),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:Q.value(e.authorization),Accept:`application/json`}),errorEnvelope,unknownError:e=>new UnknownZendeskError(h(e)),parseError:({body:e,cause:t})=>new ZendeskParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`ZendeskRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const ze=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Be=/*@__PURE__*/ policy(G);const Ve=/*@__PURE__*/ policy(K);export{z as Ca,g as Pc,_ as Qc,v as Yc,y as Zc,b as _c,A as a,j as b,x as bd,S as cd,Credentials as credentials$Credentials,Le as credentials$CredentialsFromEnv,fromAccessToken as credentials$fromAccessToken,fromApiToken as credentials$fromApiToken,originFromSubdomain as credentials$originFromSubdomain,C as dd,w as ed,e as errors$API_ERRORS,t as errors$BadGateway,n as errors$BadRequest,r as errors$ConfigError,i as errors$Conflict,a as errors$DEFAULT_ERRORS,o as errors$Forbidden,s as errors$GatewayTimeout,c as errors$HTTP_STATUS_MAP,ee as errors$InternalServerError,te as errors$Locked,ne as errors$NotFound,re as errors$ServiceUnavailable,ie as errors$TooManyRequests,ae as errors$Unauthorized,UnknownZendeskError as errors$UnknownZendeskError,se as errors$UnprocessableEntity,ZendeskParseError as errors$ZendeskParseError,$ as errors$ZendeskServiceErrors,M as f,T as gd,E as hd,D as jd,N as l,P as m,F as n,I as o,O as od,V as pagination$paginateCursor,H as pagination$paginatePageNumber,k as pd,Re as protocol$ZendeskProtocol,Retry as retry$Retry,U as retry$capped,W as retry$jittered,ue as retry$makeDefault,ze as retry$none,policy as retry$policy,Be as retry$throttling,G as retry$throttlingFactory,de as retry$throttlingOptions,Ve as retry$transient,K as retry$transientFactory,fe as retry$transientOptions,pe as traits$Body,me as traits$FormDataFile,he as traits$Header,ge as traits$Http,_e as traits$HttpBody,ve as traits$KeyDictionary,ye as traits$Label,be as traits$Query,le as traits$RawResponse,l as traits$RawResponseRoot,xe as traits$ResponseCode,u as traits$SensitiveValue,Se as traits$UnionCases,Ce as traits$applyErrorMatchers,we as traits$bodySymbol,Te as traits$errorMatchersSymbol,Ee as traits$formDataFileSymbol,De as traits$getErrorMatchers,Oe as traits$headerSymbol,ke as traits$httpBodySymbol,Ae as traits$httpSymbol,je as traits$keyDictionarySymbol,Me as traits$labelSymbol,Ne as traits$querySymbol,d as traits$rawResponseRootSymbol,f as traits$rawResponseSymbol,Pe as traits$responseCodeSymbol,m as traits$sensitiveValueSymbol,Fe as traits$unionCasesSymbol,L as ya,R as za};
|
|
2
2
|
//# sourceMappingURL=sdk.js.map
|
package/lib/_bundle/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnknownErrorFields","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnknownErrorFields","UnprocessableEntity","originFromConfig","RawResponse","RawResponseRoot","SensitiveValue","rawResponseRootSymbol","rawResponseSymbol","restProtocol","sensitiveValueSymbol","unknownErrorProps","Array","Boolean","NullOr","Number","Record","String","Struct","StructWithRest","TaggedError","Union","Unknown","at","optional","suspend","D","call","error","named","newError","op","opPaginated","withAuthError","withBadRequestError","withConflictError","withParseError","paginateCursor","paginatePageNumber","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","TaggedError$1","Unknown$1","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Base64","Layer","Redacted","url","host","subdomain","email","apiToken","accessToken","origin","config","resolved","CredentialsFromEnv","apiBaseUrl","apiTokenEnv","accessTokenEnv","ZendeskServiceErrors","body","b","code","message","ZendeskProtocol","creds","info","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"+7EA+BA,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CACzE,oBACF,EAAA,AAAE,CAAC,EAEL,MAAM,mBAAsB,GAAwB4F,EAAI,QAAQ,OAAQ,EAAE,EAG1E,MAAa,oBAAuB,GAA8B,CAChE,MAAMC,EAAOC,EACV,KAAK,CAAC,CACN,QAAQ,eAAgB,EAAE,CAAC,CAC3B,QAAQ,OAAQ,EAAE,EACrB,GAAID,EAAK,SAAS,GAAG,EAAG,MAAO,WAAWA,IAC1C,MAAO,WAAWA,EAAK,aACzB,EAEA,MAAM,YACJ,EACA,IAEAF,EAAS,KAAK,SAASF,GAAO,OAAO,GAAGM,EAAM,SAASJ,EAAS,MAAMK,CAAQ,GAAG,GAAG,EAEtF,MAAM,YAAe,GACnBL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AAI,oBAAoBpF,EAAkBqF,CAAI,CAAC,EACvE,YAAa,CAAE,OAAM,WAAY,IAAI,kBAAkB,CAAE,OAAM,OAAM,CAAC,CACxE,CAAC,EC5CD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,cAAc,EAAA,AAAE,CAAC,EAG3F,MAAa,OAAU,GACrBxB,EAAO,QAAQE,EAAM,QAAQ,MAAOuB,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAOzD,CAAiB,EAGhE,MAAa0D,GAA0B,qBAAOxD,CAAgB"}
|
package/lib/credentials.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ConfigError } from "@distilled.cloud/core/errors";
|
|
|
3
3
|
* Zendesk credentials -- hand-written.
|
|
4
4
|
*
|
|
5
5
|
* The `Credentials` service holds an *effect* that resolves the current
|
|
6
|
-
* credentials on every request (the protocol
|
|
6
|
+
* credentials on every request (the protocol resolves it per request
|
|
7
7
|
* on the calling fiber).
|
|
8
8
|
*
|
|
9
9
|
* Zendesk Support authenticates as HTTP Basic with `{email}/token:{apiToken}`
|
|
@@ -11,6 +11,10 @@ import { ConfigError } from "@distilled.cloud/core/errors";
|
|
|
11
11
|
* OpenAPI document already include the `/api/v2` prefix, so `apiBaseUrl` is
|
|
12
12
|
* the account origin (`https://{subdomain}.zendesk.com`).
|
|
13
13
|
*
|
|
14
|
+
* A layer here reads and checks its configuration when it is built: a
|
|
15
|
+
* missing value or a subdomain that is more than a host is a `ConfigError`
|
|
16
|
+
* at setup, and no call fails for it.
|
|
17
|
+
*
|
|
14
18
|
* @see https://developer.zendesk.com/api-reference/introduction/security-and-auth/
|
|
15
19
|
*/
|
|
16
20
|
import * as Context from "effect/Context";
|
|
@@ -21,28 +25,35 @@ export interface Config {
|
|
|
21
25
|
readonly authorization: Redacted.Redacted<string>;
|
|
22
26
|
readonly apiBaseUrl: string;
|
|
23
27
|
}
|
|
24
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "ZendeskCredentials", Effect.Effect<Config,
|
|
28
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "ZendeskCredentials", Effect.Effect<Config, never, never>>;
|
|
25
29
|
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
26
30
|
}
|
|
27
31
|
/** Account origin from a subdomain (`acme`) or host (`acme.zendesk.com`). */
|
|
28
32
|
export declare const originFromSubdomain: (subdomain: string) => string;
|
|
29
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Layer from an API token (`{email}/token`) + subdomain, which is checked
|
|
35
|
+
* when the layer is built.
|
|
36
|
+
*/
|
|
30
37
|
export declare const fromApiToken: (config: {
|
|
31
38
|
readonly email: string;
|
|
32
39
|
readonly apiToken: Redacted.Redacted<string>;
|
|
33
40
|
readonly subdomain?: string;
|
|
34
41
|
readonly apiBaseUrl?: string;
|
|
35
|
-
}) => Layer.Layer<Credentials>;
|
|
36
|
-
/**
|
|
42
|
+
}) => Layer.Layer<Credentials, ConfigError>;
|
|
43
|
+
/**
|
|
44
|
+
* Layer from an OAuth access token + subdomain, which is checked when the
|
|
45
|
+
* layer is built.
|
|
46
|
+
*/
|
|
37
47
|
export declare const fromAccessToken: (config: {
|
|
38
48
|
readonly accessToken: Redacted.Redacted<string>;
|
|
39
49
|
readonly subdomain?: string;
|
|
40
50
|
readonly apiBaseUrl?: string;
|
|
41
|
-
}) => Layer.Layer<Credentials>;
|
|
51
|
+
}) => Layer.Layer<Credentials, ConfigError>;
|
|
42
52
|
/**
|
|
43
53
|
* Reads ZENDESK_SUBDOMAIN (or ZENDESK_API_BASE_URL) plus either
|
|
44
|
-
* ZENDESK_EMAIL + ZENDESK_API_TOKEN or ZENDESK_ACCESS_TOKEN.
|
|
54
|
+
* ZENDESK_EMAIL + ZENDESK_API_TOKEN or ZENDESK_ACCESS_TOKEN. The environment
|
|
55
|
+
* is read, and the subdomain checked, once: when the layer is built.
|
|
45
56
|
*/
|
|
46
|
-
export declare const CredentialsFromEnv: Layer.Layer<Credentials>;
|
|
57
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError>;
|
|
47
58
|
export {};
|
|
48
59
|
//# sourceMappingURL=credentials.d.ts.map
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAErB;CAAG;AAIN,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,cAAe,MAAM,KAAG,MAOvD,CAAC;AAuCF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAY;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAMrC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,eAAe,WAAY;IACtC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAMrC,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAqCpE,CAAC"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -30,4 +30,11 @@ declare const ZendeskParseError_base: Schema.TaggedErrorClass<"ZendeskParseError
|
|
|
30
30
|
/** Schema parse error wrapper (kept for surface parity with other SDKs). */
|
|
31
31
|
export declare class ZendeskParseError extends /*@__PURE__*/ ZendeskParseError_base {
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The errors declared on the Zendesk service: any operation can return them,
|
|
35
|
+
* and every generated operation lists them as its `serviceErrors`. Today that
|
|
36
|
+
* is each of core's status classes (401, 403, 404, 429, the 5xx ...).
|
|
37
|
+
*/
|
|
38
|
+
export declare const ZendeskServiceErrors: readonly [typeof import("@distilled.cloud/core/errors").Unauthorized, typeof import("@distilled.cloud/core/errors").Forbidden, typeof import("@distilled.cloud/core/errors").NotFound, typeof import("@distilled.cloud/core/errors").BadRequest, typeof import("@distilled.cloud/core/errors").Conflict, typeof import("@distilled.cloud/core/errors").UnprocessableEntity, typeof import("@distilled.cloud/core/errors").TooManyRequests, typeof import("@distilled.cloud/core/errors").Locked, typeof import("@distilled.cloud/core/errors").InternalServerError, typeof import("@distilled.cloud/core/errors").BadGateway, typeof import("@distilled.cloud/core/errors").ServiceUnavailable, typeof import("@distilled.cloud/core/errors").GatewayTimeout];
|
|
39
|
+
export type ZendeskServiceError = InstanceType<(typeof ZendeskServiceErrors)[number]>;
|
|
33
40
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;AAElE,+EAA+E;AAC/E,qBAAa,mBACX,SAAQ,aAAa,CAAC,wBAGrB;CAAG;;;;;;;;;AAEN,4EAA4E;AAC5E,qBAAa,iBACX,SAAQ,aAAa,CAAC,sBAGU;CAAG;AAErC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+tBAAa,CAAC;AAC/C,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownZendeskError as UnknownZendeskError, errors$UnprocessableEntity as UnprocessableEntity, errors$ZendeskParseError as ZendeskParseError } from "./_bundle/sdk.js";
|
|
1
|
+
export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownZendeskError as UnknownZendeskError, errors$UnprocessableEntity as UnprocessableEntity, errors$ZendeskParseError as ZendeskParseError, errors$ZendeskServiceErrors as ZendeskServiceErrors } from "./_bundle/sdk.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAKhD,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
|
package/lib/index.lazy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,eAAe,EAA8C,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,wEAAwE;AACxE,yBAAyB;AACzB,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
|
package/lib/pagination.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
|
|
3
|
-
import type { SdkError } from "@distilled.cloud/core/sdk-error";
|
|
1
|
+
import type { ErrorOf } from "@distilled.cloud/core/protocol";
|
|
4
2
|
import type * as HttpClient from "effect/http/HttpClient";
|
|
5
|
-
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
6
|
-
import type * as Layer from "effect/Layer";
|
|
7
3
|
import { Credentials } from "./credentials.ts";
|
|
8
|
-
import { UnknownZendeskError, ZendeskParseError } from "./errors.ts";
|
|
4
|
+
import { UnknownZendeskError, ZendeskParseError, type ZendeskServiceError } from "./errors.ts";
|
|
9
5
|
/**
|
|
10
|
-
*
|
|
11
|
-
* service
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* What every generated Zendesk operation fails with besides its own errors:
|
|
7
|
+
* the service's errors, the protocol's, and what resolving the credentials
|
|
8
|
+
* fails with. Generated service files annotate operations with
|
|
9
|
+
* `API.OperationMethod<I, O, ZendeskOpError, ZendeskOpContext>` explicitly so
|
|
10
|
+
* the compiler never infers these back out of the schema generics.
|
|
14
11
|
*/
|
|
15
|
-
export type ZendeskOpError =
|
|
12
|
+
export type ZendeskOpError = ZendeskServiceError | ErrorOf<typeof ZendeskProtocol>;
|
|
16
13
|
/** Context (requirements) shared by every generated Zendesk operation. */
|
|
17
14
|
export type ZendeskOpContext = Credentials | HttpClient.HttpClient;
|
|
18
|
-
export declare const ZendeskProtocol:
|
|
15
|
+
export declare const ZendeskProtocol: import("@distilled.cloud/core/protocol").Protocol<UnknownZendeskError | ZendeskParseError | import("@distilled.cloud/core/protocol-rest").RestProtocolError, Credentials>;
|
|
19
16
|
//# sourceMappingURL=protocol.d.ts.map
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAuB9D,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE/F;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG,OAAO,CAAC,OAAO,eAAe,CAAC,CAAC;AAEnF,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AA4BnE,eAAO,MAAM,eAAe,2KAY1B,CAAC"}
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,uEAAuE;AACvE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAAgD;CAAG;AAE5F,yEAAyE;AACzE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA0C,CAAC;AAElE,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC"}
|