@crevio/sdk 0.1.0 → 0.2.0
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 +8 -12
- package/RUNTIMES.md +6 -6
- package/dist/commonjs/funcs/accountsGet.js +1 -1
- package/dist/commonjs/funcs/accountsGet.js.map +1 -1
- package/dist/commonjs/funcs/checkoutsCreate.js +1 -1
- package/dist/commonjs/funcs/checkoutsCreate.js.map +1 -1
- package/dist/commonjs/funcs/productsGet.js +1 -1
- package/dist/commonjs/funcs/productsGet.js.map +1 -1
- package/dist/commonjs/funcs/productsList.js +2 -2
- package/dist/commonjs/funcs/productsList.js.map +1 -1
- package/dist/commonjs/funcs/userDelete.js +1 -1
- package/dist/commonjs/funcs/userDelete.js.map +1 -1
- package/dist/commonjs/funcs/userGet.js +1 -1
- package/dist/commonjs/funcs/userGet.js.map +1 -1
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -1
- package/dist/commonjs/hooks/hooks.js +0 -2
- package/dist/commonjs/hooks/hooks.js.map +1 -1
- package/dist/commonjs/lib/base64.d.ts +1 -1
- package/dist/commonjs/lib/base64.d.ts.map +1 -1
- package/dist/commonjs/lib/base64.js +1 -1
- package/dist/commonjs/lib/base64.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +4 -4
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +5 -5
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/encodings.d.ts +1 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -1
- package/dist/commonjs/lib/encodings.js +12 -1
- package/dist/commonjs/lib/encodings.js.map +1 -1
- package/dist/commonjs/lib/env.d.ts +1 -1
- package/dist/commonjs/lib/env.d.ts.map +1 -1
- package/dist/commonjs/lib/env.js +19 -2
- package/dist/commonjs/lib/env.js.map +1 -1
- package/dist/commonjs/lib/schemas.d.ts +1 -1
- package/dist/commonjs/lib/schemas.d.ts.map +1 -1
- package/dist/commonjs/lib/schemas.js +2 -2
- package/dist/commonjs/lib/schemas.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/lib/url.js +1 -1
- package/dist/commonjs/lib/url.js.map +1 -1
- package/dist/commonjs/models/account.d.ts +4 -29
- package/dist/commonjs/models/account.d.ts.map +1 -1
- package/dist/commonjs/models/account.js +2 -34
- package/dist/commonjs/models/account.js.map +1 -1
- package/dist/commonjs/models/accountslim.d.ts +1 -22
- package/dist/commonjs/models/accountslim.d.ts.map +1 -1
- package/dist/commonjs/models/accountslim.js +2 -23
- package/dist/commonjs/models/accountslim.js.map +1 -1
- package/dist/commonjs/models/checkoutrequest.d.ts +1 -48
- package/dist/commonjs/models/checkoutrequest.d.ts.map +1 -1
- package/dist/commonjs/models/checkoutrequest.js +2 -78
- package/dist/commonjs/models/checkoutrequest.js.map +1 -1
- package/dist/commonjs/models/checkoutresponse.d.ts +1 -21
- package/dist/commonjs/models/checkoutresponse.d.ts.map +1 -1
- package/dist/commonjs/models/checkoutresponse.js +2 -27
- package/dist/commonjs/models/checkoutresponse.js.map +1 -1
- package/dist/commonjs/models/errors/error.d.ts +1 -20
- package/dist/commonjs/models/errors/error.d.ts.map +1 -1
- package/dist/commonjs/models/errors/error.js +2 -20
- package/dist/commonjs/models/errors/error.js.map +1 -1
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/responsevalidationerror.js +1 -1
- package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -1
- package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +1 -1
- package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/sdkvalidationerror.js +1 -1
- package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -1
- package/dist/commonjs/models/fileattachment.d.ts +1 -24
- package/dist/commonjs/models/fileattachment.d.ts.map +1 -1
- package/dist/commonjs/models/fileattachment.js +2 -30
- package/dist/commonjs/models/fileattachment.js.map +1 -1
- package/dist/commonjs/models/imageattachment.d.ts +1 -24
- package/dist/commonjs/models/imageattachment.d.ts.map +1 -1
- package/dist/commonjs/models/imageattachment.js +2 -30
- package/dist/commonjs/models/imageattachment.js.map +1 -1
- package/dist/commonjs/models/linkinbiopage.d.ts +1 -22
- package/dist/commonjs/models/linkinbiopage.d.ts.map +1 -1
- package/dist/commonjs/models/linkinbiopage.js +2 -23
- package/dist/commonjs/models/linkinbiopage.js.map +1 -1
- package/dist/commonjs/models/operations/delete.d.ts +1 -18
- package/dist/commonjs/models/operations/delete.d.ts.map +1 -1
- package/dist/commonjs/models/operations/delete.js +2 -19
- package/dist/commonjs/models/operations/delete.js.map +1 -1
- package/dist/commonjs/models/operations/getaccount.d.ts +1 -18
- package/dist/commonjs/models/operations/getaccount.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getaccount.js +2 -26
- package/dist/commonjs/models/operations/getaccount.js.map +1 -1
- package/dist/commonjs/models/operations/getproduct.d.ts +1 -18
- package/dist/commonjs/models/operations/getproduct.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getproduct.js +2 -26
- package/dist/commonjs/models/operations/getproduct.js.map +1 -1
- package/dist/commonjs/models/pricevariant.d.ts +1 -27
- package/dist/commonjs/models/pricevariant.d.ts.map +1 -1
- package/dist/commonjs/models/pricevariant.js +2 -32
- package/dist/commonjs/models/pricevariant.js.map +1 -1
- package/dist/commonjs/models/product.d.ts +8 -62
- package/dist/commonjs/models/product.d.ts.map +1 -1
- package/dist/commonjs/models/product.js +3 -61
- package/dist/commonjs/models/product.js.map +1 -1
- package/dist/commonjs/models/review.d.ts +1 -23
- package/dist/commonjs/models/review.d.ts.map +1 -1
- package/dist/commonjs/models/review.js +2 -28
- package/dist/commonjs/models/review.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +1 -18
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +2 -26
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/models/seo.d.ts +1 -22
- package/dist/commonjs/models/seo.d.ts.map +1 -1
- package/dist/commonjs/models/seo.js +2 -24
- package/dist/commonjs/models/seo.js.map +1 -1
- package/dist/commonjs/models/sociallink.d.ts +1 -23
- package/dist/commonjs/models/sociallink.d.ts.map +1 -1
- package/dist/commonjs/models/sociallink.js +2 -24
- package/dist/commonjs/models/sociallink.js.map +1 -1
- package/dist/commonjs/models/user.d.ts +3 -39
- package/dist/commonjs/models/user.d.ts.map +1 -1
- package/dist/commonjs/models/user.js +2 -54
- package/dist/commonjs/models/user.js.map +1 -1
- package/dist/commonjs/types/blobs.d.ts +1 -1
- package/dist/commonjs/types/blobs.d.ts.map +1 -1
- package/dist/commonjs/types/blobs.js +1 -1
- package/dist/commonjs/types/blobs.js.map +1 -1
- package/dist/commonjs/types/constdatetime.d.ts +1 -1
- package/dist/commonjs/types/constdatetime.d.ts.map +1 -1
- package/dist/commonjs/types/constdatetime.js +1 -1
- package/dist/commonjs/types/constdatetime.js.map +1 -1
- package/dist/commonjs/types/enums.d.ts +8 -11
- package/dist/commonjs/types/enums.d.ts.map +1 -1
- package/dist/commonjs/types/enums.js +59 -3
- package/dist/commonjs/types/enums.js.map +1 -1
- package/dist/commonjs/types/index.d.ts +2 -2
- package/dist/commonjs/types/index.d.ts.map +1 -1
- package/dist/commonjs/types/index.js +16 -3
- package/dist/commonjs/types/index.js.map +1 -1
- package/dist/commonjs/types/unrecognized.d.ts +16 -0
- package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
- package/dist/commonjs/types/unrecognized.js +34 -0
- package/dist/commonjs/types/unrecognized.js.map +1 -0
- package/dist/esm/funcs/accountsGet.js +1 -1
- package/dist/esm/funcs/accountsGet.js.map +1 -1
- package/dist/esm/funcs/checkoutsCreate.js +1 -1
- package/dist/esm/funcs/checkoutsCreate.js.map +1 -1
- package/dist/esm/funcs/productsGet.js +1 -1
- package/dist/esm/funcs/productsGet.js.map +1 -1
- package/dist/esm/funcs/productsList.js +2 -2
- package/dist/esm/funcs/productsList.js.map +1 -1
- package/dist/esm/funcs/userDelete.js +1 -1
- package/dist/esm/funcs/userDelete.js.map +1 -1
- package/dist/esm/funcs/userGet.js +1 -1
- package/dist/esm/funcs/userGet.js.map +1 -1
- package/dist/esm/hooks/hooks.d.ts.map +1 -1
- package/dist/esm/hooks/hooks.js +0 -2
- package/dist/esm/hooks/hooks.js.map +1 -1
- package/dist/esm/lib/base64.d.ts +1 -1
- package/dist/esm/lib/base64.d.ts.map +1 -1
- package/dist/esm/lib/base64.js +1 -1
- package/dist/esm/lib/base64.js.map +1 -1
- package/dist/esm/lib/config.d.ts +4 -4
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +5 -5
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/encodings.d.ts +1 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -1
- package/dist/esm/lib/encodings.js +12 -1
- package/dist/esm/lib/encodings.js.map +1 -1
- package/dist/esm/lib/env.d.ts +1 -1
- package/dist/esm/lib/env.d.ts.map +1 -1
- package/dist/esm/lib/env.js +19 -2
- package/dist/esm/lib/env.js.map +1 -1
- package/dist/esm/lib/schemas.d.ts +1 -1
- package/dist/esm/lib/schemas.d.ts.map +1 -1
- package/dist/esm/lib/schemas.js +1 -1
- package/dist/esm/lib/schemas.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/lib/url.js +1 -1
- package/dist/esm/lib/url.js.map +1 -1
- package/dist/esm/models/account.d.ts +4 -29
- package/dist/esm/models/account.d.ts.map +1 -1
- package/dist/esm/models/account.js +4 -35
- package/dist/esm/models/account.js.map +1 -1
- package/dist/esm/models/accountslim.d.ts +1 -22
- package/dist/esm/models/accountslim.d.ts.map +1 -1
- package/dist/esm/models/accountslim.js +1 -21
- package/dist/esm/models/accountslim.js.map +1 -1
- package/dist/esm/models/checkoutrequest.d.ts +1 -48
- package/dist/esm/models/checkoutrequest.d.ts.map +1 -1
- package/dist/esm/models/checkoutrequest.js +1 -74
- package/dist/esm/models/checkoutrequest.js.map +1 -1
- package/dist/esm/models/checkoutresponse.d.ts +1 -21
- package/dist/esm/models/checkoutresponse.d.ts.map +1 -1
- package/dist/esm/models/checkoutresponse.js +1 -25
- package/dist/esm/models/checkoutresponse.js.map +1 -1
- package/dist/esm/models/errors/error.d.ts +1 -20
- package/dist/esm/models/errors/error.d.ts.map +1 -1
- package/dist/esm/models/errors/error.js +1 -19
- package/dist/esm/models/errors/error.js.map +1 -1
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/responsevalidationerror.js +1 -1
- package/dist/esm/models/errors/responsevalidationerror.js.map +1 -1
- package/dist/esm/models/errors/sdkvalidationerror.d.ts +1 -1
- package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/dist/esm/models/errors/sdkvalidationerror.js +1 -1
- package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -1
- package/dist/esm/models/fileattachment.d.ts +1 -24
- package/dist/esm/models/fileattachment.d.ts.map +1 -1
- package/dist/esm/models/fileattachment.js +1 -28
- package/dist/esm/models/fileattachment.js.map +1 -1
- package/dist/esm/models/imageattachment.d.ts +1 -24
- package/dist/esm/models/imageattachment.d.ts.map +1 -1
- package/dist/esm/models/imageattachment.js +1 -28
- package/dist/esm/models/imageattachment.js.map +1 -1
- package/dist/esm/models/linkinbiopage.d.ts +1 -22
- package/dist/esm/models/linkinbiopage.d.ts.map +1 -1
- package/dist/esm/models/linkinbiopage.js +1 -21
- package/dist/esm/models/linkinbiopage.js.map +1 -1
- package/dist/esm/models/operations/delete.d.ts +1 -18
- package/dist/esm/models/operations/delete.d.ts.map +1 -1
- package/dist/esm/models/operations/delete.js +1 -17
- package/dist/esm/models/operations/delete.js.map +1 -1
- package/dist/esm/models/operations/getaccount.d.ts +1 -18
- package/dist/esm/models/operations/getaccount.d.ts.map +1 -1
- package/dist/esm/models/operations/getaccount.js +1 -24
- package/dist/esm/models/operations/getaccount.js.map +1 -1
- package/dist/esm/models/operations/getproduct.d.ts +1 -18
- package/dist/esm/models/operations/getproduct.d.ts.map +1 -1
- package/dist/esm/models/operations/getproduct.js +1 -24
- package/dist/esm/models/operations/getproduct.js.map +1 -1
- package/dist/esm/models/pricevariant.d.ts +1 -27
- package/dist/esm/models/pricevariant.d.ts.map +1 -1
- package/dist/esm/models/pricevariant.js +1 -30
- package/dist/esm/models/pricevariant.js.map +1 -1
- package/dist/esm/models/product.d.ts +8 -62
- package/dist/esm/models/product.d.ts.map +1 -1
- package/dist/esm/models/product.js +8 -65
- package/dist/esm/models/product.js.map +1 -1
- package/dist/esm/models/review.d.ts +1 -23
- package/dist/esm/models/review.d.ts.map +1 -1
- package/dist/esm/models/review.js +1 -26
- package/dist/esm/models/review.js.map +1 -1
- package/dist/esm/models/security.d.ts +1 -18
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +1 -24
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/models/seo.d.ts +1 -22
- package/dist/esm/models/seo.d.ts.map +1 -1
- package/dist/esm/models/seo.js +1 -22
- package/dist/esm/models/seo.js.map +1 -1
- package/dist/esm/models/sociallink.d.ts +1 -23
- package/dist/esm/models/sociallink.d.ts.map +1 -1
- package/dist/esm/models/sociallink.js +1 -22
- package/dist/esm/models/sociallink.js.map +1 -1
- package/dist/esm/models/user.d.ts +3 -39
- package/dist/esm/models/user.d.ts.map +1 -1
- package/dist/esm/models/user.js +3 -54
- package/dist/esm/models/user.js.map +1 -1
- package/dist/esm/types/blobs.d.ts +1 -1
- package/dist/esm/types/blobs.d.ts.map +1 -1
- package/dist/esm/types/blobs.js +1 -1
- package/dist/esm/types/blobs.js.map +1 -1
- package/dist/esm/types/constdatetime.d.ts +1 -1
- package/dist/esm/types/constdatetime.d.ts.map +1 -1
- package/dist/esm/types/constdatetime.js +1 -1
- package/dist/esm/types/constdatetime.js.map +1 -1
- package/dist/esm/types/enums.d.ts +8 -11
- package/dist/esm/types/enums.d.ts.map +1 -1
- package/dist/esm/types/enums.js +22 -2
- package/dist/esm/types/enums.js.map +1 -1
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/unrecognized.d.ts +16 -0
- package/dist/esm/types/unrecognized.d.ts.map +1 -0
- package/dist/esm/types/unrecognized.js +31 -0
- package/dist/esm/types/unrecognized.js.map +1 -0
- package/examples/package-lock.json +4 -4
- package/examples/userGet.example.ts +2 -2
- package/jsr.json +1 -1
- package/package.json +4 -4
- package/src/funcs/accountsGet.ts +1 -1
- package/src/funcs/checkoutsCreate.ts +1 -1
- package/src/funcs/productsGet.ts +1 -1
- package/src/funcs/productsList.ts +2 -2
- package/src/funcs/userDelete.ts +1 -1
- package/src/funcs/userGet.ts +1 -1
- package/src/hooks/hooks.ts +0 -3
- package/src/lib/base64.ts +1 -1
- package/src/lib/config.ts +5 -5
- package/src/lib/encodings.ts +17 -3
- package/src/lib/env.ts +21 -5
- package/src/lib/schemas.ts +1 -1
- package/src/lib/security.ts +4 -1
- package/src/lib/url.ts +1 -1
- package/src/models/account.ts +3 -65
- package/src/models/accountslim.ts +1 -36
- package/src/models/checkoutrequest.ts +1 -120
- package/src/models/checkoutresponse.ts +1 -43
- package/src/models/errors/error.ts +1 -32
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/responsevalidationerror.ts +1 -1
- package/src/models/errors/sdkvalidationerror.ts +1 -1
- package/src/models/fileattachment.ts +1 -45
- package/src/models/imageattachment.ts +1 -47
- package/src/models/linkinbiopage.ts +1 -36
- package/src/models/operations/delete.ts +1 -28
- package/src/models/operations/getaccount.ts +1 -40
- package/src/models/operations/getproduct.ts +1 -40
- package/src/models/pricevariant.ts +1 -50
- package/src/models/product.ts +6 -117
- package/src/models/review.ts +1 -42
- package/src/models/security.ts +1 -40
- package/src/models/seo.ts +1 -33
- package/src/models/sociallink.ts +1 -38
- package/src/models/user.ts +2 -87
- package/src/types/blobs.ts +7 -6
- package/src/types/constdatetime.ts +1 -1
- package/src/types/enums.ts +38 -9
- package/src/types/index.ts +2 -2
- package/src/types/unrecognized.ts +35 -0
- package/tsconfig.json +0 -1
- package/.devcontainer/README.md +0 -30
- package/docs/sdks/accounts/README.md +0 -84
- package/docs/sdks/checkouts/README.md +0 -96
- package/docs/sdks/crevio/README.md +0 -7
- package/docs/sdks/products/README.md +0 -154
- package/docs/sdks/user/README.md +0 -149
- package/examples/README.md +0 -31
package/src/lib/base64.ts
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -14,11 +14,11 @@ export const ServerList = [
|
|
|
14
14
|
/**
|
|
15
15
|
* Local development server
|
|
16
16
|
*/
|
|
17
|
-
"https://crevio.localhost/api/v1",
|
|
17
|
+
"https://api.crevio.localhost/api/v1",
|
|
18
18
|
/**
|
|
19
19
|
* Production server
|
|
20
20
|
*/
|
|
21
|
-
"https://api.crevio.
|
|
21
|
+
"https://api.crevio.co/api/v1",
|
|
22
22
|
] as const;
|
|
23
23
|
|
|
24
24
|
export type SDKOptions = {
|
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.0.0",
|
|
68
|
-
sdkVersion: "0.
|
|
69
|
-
genVersion: "2.
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
68
|
+
sdkVersion: "0.2.0",
|
|
69
|
+
genVersion: "2.767.2",
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.2.0 2.767.2 1.0.0 @crevio/sdk",
|
|
71
71
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -102,8 +102,9 @@ export function encodeLabel(
|
|
|
102
102
|
});
|
|
103
103
|
encValue = mapped?.join("").slice(1);
|
|
104
104
|
} else {
|
|
105
|
-
const k =
|
|
106
|
-
|
|
105
|
+
const k = options?.explode && isPlainObject(value)
|
|
106
|
+
? `${encodeString(pk)}=`
|
|
107
|
+
: "";
|
|
107
108
|
encValue = `${k}${encodeValue(pv)}`;
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -426,6 +427,7 @@ export function queryJoin(...args: (string | undefined)[]): string {
|
|
|
426
427
|
type QueryEncoderOptions = {
|
|
427
428
|
explode?: boolean;
|
|
428
429
|
charEncoding?: "percent" | "none";
|
|
430
|
+
allowEmptyValue?: string[];
|
|
429
431
|
};
|
|
430
432
|
|
|
431
433
|
type QueryEncoder = (
|
|
@@ -440,7 +442,7 @@ type BulkQueryEncoder = (
|
|
|
440
442
|
) => string;
|
|
441
443
|
|
|
442
444
|
export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
|
|
443
|
-
const bulkEncode = function
|
|
445
|
+
const bulkEncode = function(
|
|
444
446
|
values: Record<string, unknown>,
|
|
445
447
|
options?: QueryEncoderOptions,
|
|
446
448
|
): string {
|
|
@@ -450,7 +452,19 @@ export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
|
|
|
450
452
|
charEncoding: options?.charEncoding ?? "percent",
|
|
451
453
|
};
|
|
452
454
|
|
|
455
|
+
const allowEmptySet = new Set(options?.allowEmptyValue ?? []);
|
|
456
|
+
|
|
453
457
|
const encoded = Object.entries(values).map(([key, value]) => {
|
|
458
|
+
if (allowEmptySet.has(key)) {
|
|
459
|
+
if (
|
|
460
|
+
value === undefined
|
|
461
|
+
|| value === null
|
|
462
|
+
|| value === ""
|
|
463
|
+
|| (Array.isArray(value) && value.length === 0)
|
|
464
|
+
) {
|
|
465
|
+
return `${encodeURIComponent(key)}=`;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
454
468
|
return f(key, value, opts);
|
|
455
469
|
});
|
|
456
470
|
return queryJoin(...encoded);
|
package/src/lib/env.ts
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import * as z from "zod/v3";
|
|
5
6
|
import { dlv } from "./dlv.js";
|
|
6
7
|
|
|
7
|
-
import * as z from "zod";
|
|
8
|
-
|
|
9
8
|
export interface Env {
|
|
10
9
|
CREVIO_API_KEY_AUTH?: string | undefined;
|
|
11
10
|
|
|
@@ -18,6 +17,18 @@ export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
|
|
|
18
17
|
CREVIO_DEBUG: z.coerce.boolean().optional(),
|
|
19
18
|
});
|
|
20
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Checks for the existence of the Deno global object to determine the environment.
|
|
22
|
+
* @returns {boolean} True if the runtime is Deno, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
function isDeno() {
|
|
25
|
+
if ("Deno" in globalThis) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
21
32
|
let envMemo: Env | undefined = undefined;
|
|
22
33
|
/**
|
|
23
34
|
* Reads and validates environment variables.
|
|
@@ -27,9 +38,14 @@ export function env(): Env {
|
|
|
27
38
|
return envMemo;
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
let envObject: Record<string, unknown> = {};
|
|
42
|
+
if (isDeno()) {
|
|
43
|
+
envObject = (globalThis as any).Deno?.env?.toObject?.() ?? {};
|
|
44
|
+
} else {
|
|
45
|
+
envObject = dlv(globalThis, "process.env") ?? {};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
envMemo = envSchema.parse(envObject);
|
|
33
49
|
return envMemo;
|
|
34
50
|
}
|
|
35
51
|
|
package/src/lib/schemas.ts
CHANGED
package/src/lib/security.ts
CHANGED
|
@@ -84,7 +84,10 @@ type SecurityInputOAuth2 = {
|
|
|
84
84
|
type SecurityInputOAuth2ClientCredentials = {
|
|
85
85
|
type: "oauth2:client_credentials";
|
|
86
86
|
value:
|
|
87
|
-
| {
|
|
87
|
+
| {
|
|
88
|
+
clientID?: string | undefined;
|
|
89
|
+
clientSecret?: string | undefined;
|
|
90
|
+
}
|
|
88
91
|
| null
|
|
89
92
|
| string
|
|
90
93
|
| undefined;
|
package/src/lib/url.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function pathToFunc(
|
|
|
10
10
|
pathPattern: string,
|
|
11
11
|
options?: { charEncoding?: "percent" | "none" },
|
|
12
12
|
): (params?: Params) => string {
|
|
13
|
-
const paramRE = /\{([a-zA-Z0-9_]
|
|
13
|
+
const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
|
|
14
14
|
|
|
15
15
|
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
|
16
16
|
return pathPattern.replace(paramRE, function (_, placeholder) {
|
package/src/models/account.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
@@ -10,21 +10,9 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
10
10
|
import {
|
|
11
11
|
ImageAttachment,
|
|
12
12
|
ImageAttachment$inboundSchema,
|
|
13
|
-
ImageAttachment$Outbound,
|
|
14
|
-
ImageAttachment$outboundSchema,
|
|
15
13
|
} from "./imageattachment.js";
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
LinkInBioPage$inboundSchema,
|
|
19
|
-
LinkInBioPage$Outbound,
|
|
20
|
-
LinkInBioPage$outboundSchema,
|
|
21
|
-
} from "./linkinbiopage.js";
|
|
22
|
-
import {
|
|
23
|
-
SocialLink,
|
|
24
|
-
SocialLink$inboundSchema,
|
|
25
|
-
SocialLink$Outbound,
|
|
26
|
-
SocialLink$outboundSchema,
|
|
27
|
-
} from "./sociallink.js";
|
|
14
|
+
import { LinkInBioPage, LinkInBioPage$inboundSchema } from "./linkinbiopage.js";
|
|
15
|
+
import { SocialLink, SocialLink$inboundSchema } from "./sociallink.js";
|
|
28
16
|
|
|
29
17
|
export type Account = {
|
|
30
18
|
id?: number | undefined;
|
|
@@ -55,56 +43,6 @@ export const Account$inboundSchema: z.ZodType<Account, z.ZodTypeDef, unknown> =
|
|
|
55
43
|
});
|
|
56
44
|
});
|
|
57
45
|
|
|
58
|
-
/** @internal */
|
|
59
|
-
export type Account$Outbound = {
|
|
60
|
-
id?: number | undefined;
|
|
61
|
-
name?: string | undefined;
|
|
62
|
-
subdomain?: string | undefined;
|
|
63
|
-
avatar_blob?: ImageAttachment$Outbound | undefined;
|
|
64
|
-
link_in_bio_page?: LinkInBioPage$Outbound | undefined;
|
|
65
|
-
social_links?: Array<SocialLink$Outbound> | undefined;
|
|
66
|
-
referral_url?: string | undefined;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/** @internal */
|
|
70
|
-
export const Account$outboundSchema: z.ZodType<
|
|
71
|
-
Account$Outbound,
|
|
72
|
-
z.ZodTypeDef,
|
|
73
|
-
Account
|
|
74
|
-
> = z.object({
|
|
75
|
-
id: z.number().int().optional(),
|
|
76
|
-
name: z.string().optional(),
|
|
77
|
-
subdomain: z.string().optional(),
|
|
78
|
-
avatarBlob: ImageAttachment$outboundSchema.optional(),
|
|
79
|
-
linkInBioPage: LinkInBioPage$outboundSchema.optional(),
|
|
80
|
-
socialLinks: z.array(SocialLink$outboundSchema).optional(),
|
|
81
|
-
referralUrl: z.string().optional(),
|
|
82
|
-
}).transform((v) => {
|
|
83
|
-
return remap$(v, {
|
|
84
|
-
avatarBlob: "avatar_blob",
|
|
85
|
-
linkInBioPage: "link_in_bio_page",
|
|
86
|
-
socialLinks: "social_links",
|
|
87
|
-
referralUrl: "referral_url",
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
94
|
-
*/
|
|
95
|
-
export namespace Account$ {
|
|
96
|
-
/** @deprecated use `Account$inboundSchema` instead. */
|
|
97
|
-
export const inboundSchema = Account$inboundSchema;
|
|
98
|
-
/** @deprecated use `Account$outboundSchema` instead. */
|
|
99
|
-
export const outboundSchema = Account$outboundSchema;
|
|
100
|
-
/** @deprecated use `Account$Outbound` instead. */
|
|
101
|
-
export type Outbound = Account$Outbound;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function accountToJSON(account: Account): string {
|
|
105
|
-
return JSON.stringify(Account$outboundSchema.parse(account));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
46
|
export function accountFromJSON(
|
|
109
47
|
jsonString: string,
|
|
110
48
|
): SafeParseResult<Account, SDKValidationError> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
@@ -24,41 +24,6 @@ export const AccountSlim$inboundSchema: z.ZodType<
|
|
|
24
24
|
subdomain: z.string().optional(),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
/** @internal */
|
|
28
|
-
export type AccountSlim$Outbound = {
|
|
29
|
-
id?: number | undefined;
|
|
30
|
-
name?: string | undefined;
|
|
31
|
-
subdomain?: string | undefined;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/** @internal */
|
|
35
|
-
export const AccountSlim$outboundSchema: z.ZodType<
|
|
36
|
-
AccountSlim$Outbound,
|
|
37
|
-
z.ZodTypeDef,
|
|
38
|
-
AccountSlim
|
|
39
|
-
> = z.object({
|
|
40
|
-
id: z.number().int().optional(),
|
|
41
|
-
name: z.string().optional(),
|
|
42
|
-
subdomain: z.string().optional(),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @internal
|
|
47
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
48
|
-
*/
|
|
49
|
-
export namespace AccountSlim$ {
|
|
50
|
-
/** @deprecated use `AccountSlim$inboundSchema` instead. */
|
|
51
|
-
export const inboundSchema = AccountSlim$inboundSchema;
|
|
52
|
-
/** @deprecated use `AccountSlim$outboundSchema` instead. */
|
|
53
|
-
export const outboundSchema = AccountSlim$outboundSchema;
|
|
54
|
-
/** @deprecated use `AccountSlim$Outbound` instead. */
|
|
55
|
-
export type Outbound = AccountSlim$Outbound;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function accountSlimToJSON(accountSlim: AccountSlim): string {
|
|
59
|
-
return JSON.stringify(AccountSlim$outboundSchema.parse(accountSlim));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
27
|
export function accountSlimFromJSON(
|
|
63
28
|
jsonString: string,
|
|
64
29
|
): SafeParseResult<AccountSlim, SDKValidationError> {
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
7
|
|
|
11
8
|
export type CheckoutItemsAttribute = {
|
|
12
9
|
priceVariantId: number;
|
|
@@ -29,22 +26,6 @@ export type CheckoutRequest = {
|
|
|
29
26
|
checkout: Checkout;
|
|
30
27
|
};
|
|
31
28
|
|
|
32
|
-
/** @internal */
|
|
33
|
-
export const CheckoutItemsAttribute$inboundSchema: z.ZodType<
|
|
34
|
-
CheckoutItemsAttribute,
|
|
35
|
-
z.ZodTypeDef,
|
|
36
|
-
unknown
|
|
37
|
-
> = z.object({
|
|
38
|
-
price_variant_id: z.number().int(),
|
|
39
|
-
quantity: z.number().int().optional(),
|
|
40
|
-
custom_amount: z.number().int().optional(),
|
|
41
|
-
}).transform((v) => {
|
|
42
|
-
return remap$(v, {
|
|
43
|
-
"price_variant_id": "priceVariantId",
|
|
44
|
-
"custom_amount": "customAmount",
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
29
|
/** @internal */
|
|
49
30
|
export type CheckoutItemsAttribute$Outbound = {
|
|
50
31
|
price_variant_id: number;
|
|
@@ -68,19 +49,6 @@ export const CheckoutItemsAttribute$outboundSchema: z.ZodType<
|
|
|
68
49
|
});
|
|
69
50
|
});
|
|
70
51
|
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
74
|
-
*/
|
|
75
|
-
export namespace CheckoutItemsAttribute$ {
|
|
76
|
-
/** @deprecated use `CheckoutItemsAttribute$inboundSchema` instead. */
|
|
77
|
-
export const inboundSchema = CheckoutItemsAttribute$inboundSchema;
|
|
78
|
-
/** @deprecated use `CheckoutItemsAttribute$outboundSchema` instead. */
|
|
79
|
-
export const outboundSchema = CheckoutItemsAttribute$outboundSchema;
|
|
80
|
-
/** @deprecated use `CheckoutItemsAttribute$Outbound` instead. */
|
|
81
|
-
export type Outbound = CheckoutItemsAttribute$Outbound;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
52
|
export function checkoutItemsAttributeToJSON(
|
|
85
53
|
checkoutItemsAttribute: CheckoutItemsAttribute,
|
|
86
54
|
): string {
|
|
@@ -89,38 +57,6 @@ export function checkoutItemsAttributeToJSON(
|
|
|
89
57
|
);
|
|
90
58
|
}
|
|
91
59
|
|
|
92
|
-
export function checkoutItemsAttributeFromJSON(
|
|
93
|
-
jsonString: string,
|
|
94
|
-
): SafeParseResult<CheckoutItemsAttribute, SDKValidationError> {
|
|
95
|
-
return safeParse(
|
|
96
|
-
jsonString,
|
|
97
|
-
(x) => CheckoutItemsAttribute$inboundSchema.parse(JSON.parse(x)),
|
|
98
|
-
`Failed to parse 'CheckoutItemsAttribute' from JSON`,
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** @internal */
|
|
103
|
-
export const Checkout$inboundSchema: z.ZodType<
|
|
104
|
-
Checkout,
|
|
105
|
-
z.ZodTypeDef,
|
|
106
|
-
unknown
|
|
107
|
-
> = z.object({
|
|
108
|
-
email: z.string().optional(),
|
|
109
|
-
return_url: z.string().optional(),
|
|
110
|
-
cancel_url: z.string().optional(),
|
|
111
|
-
discount_code: z.string().optional(),
|
|
112
|
-
checkout_items_attributes: z.array(
|
|
113
|
-
z.lazy(() => CheckoutItemsAttribute$inboundSchema),
|
|
114
|
-
),
|
|
115
|
-
}).transform((v) => {
|
|
116
|
-
return remap$(v, {
|
|
117
|
-
"return_url": "returnUrl",
|
|
118
|
-
"cancel_url": "cancelUrl",
|
|
119
|
-
"discount_code": "discountCode",
|
|
120
|
-
"checkout_items_attributes": "checkoutItemsAttributes",
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
60
|
/** @internal */
|
|
125
61
|
export type Checkout$Outbound = {
|
|
126
62
|
email?: string | undefined;
|
|
@@ -152,42 +88,10 @@ export const Checkout$outboundSchema: z.ZodType<
|
|
|
152
88
|
});
|
|
153
89
|
});
|
|
154
90
|
|
|
155
|
-
/**
|
|
156
|
-
* @internal
|
|
157
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
158
|
-
*/
|
|
159
|
-
export namespace Checkout$ {
|
|
160
|
-
/** @deprecated use `Checkout$inboundSchema` instead. */
|
|
161
|
-
export const inboundSchema = Checkout$inboundSchema;
|
|
162
|
-
/** @deprecated use `Checkout$outboundSchema` instead. */
|
|
163
|
-
export const outboundSchema = Checkout$outboundSchema;
|
|
164
|
-
/** @deprecated use `Checkout$Outbound` instead. */
|
|
165
|
-
export type Outbound = Checkout$Outbound;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
91
|
export function checkoutToJSON(checkout: Checkout): string {
|
|
169
92
|
return JSON.stringify(Checkout$outboundSchema.parse(checkout));
|
|
170
93
|
}
|
|
171
94
|
|
|
172
|
-
export function checkoutFromJSON(
|
|
173
|
-
jsonString: string,
|
|
174
|
-
): SafeParseResult<Checkout, SDKValidationError> {
|
|
175
|
-
return safeParse(
|
|
176
|
-
jsonString,
|
|
177
|
-
(x) => Checkout$inboundSchema.parse(JSON.parse(x)),
|
|
178
|
-
`Failed to parse 'Checkout' from JSON`,
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/** @internal */
|
|
183
|
-
export const CheckoutRequest$inboundSchema: z.ZodType<
|
|
184
|
-
CheckoutRequest,
|
|
185
|
-
z.ZodTypeDef,
|
|
186
|
-
unknown
|
|
187
|
-
> = z.object({
|
|
188
|
-
checkout: z.lazy(() => Checkout$inboundSchema),
|
|
189
|
-
});
|
|
190
|
-
|
|
191
95
|
/** @internal */
|
|
192
96
|
export type CheckoutRequest$Outbound = {
|
|
193
97
|
checkout: Checkout$Outbound;
|
|
@@ -202,31 +106,8 @@ export const CheckoutRequest$outboundSchema: z.ZodType<
|
|
|
202
106
|
checkout: z.lazy(() => Checkout$outboundSchema),
|
|
203
107
|
});
|
|
204
108
|
|
|
205
|
-
/**
|
|
206
|
-
* @internal
|
|
207
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
208
|
-
*/
|
|
209
|
-
export namespace CheckoutRequest$ {
|
|
210
|
-
/** @deprecated use `CheckoutRequest$inboundSchema` instead. */
|
|
211
|
-
export const inboundSchema = CheckoutRequest$inboundSchema;
|
|
212
|
-
/** @deprecated use `CheckoutRequest$outboundSchema` instead. */
|
|
213
|
-
export const outboundSchema = CheckoutRequest$outboundSchema;
|
|
214
|
-
/** @deprecated use `CheckoutRequest$Outbound` instead. */
|
|
215
|
-
export type Outbound = CheckoutRequest$Outbound;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
109
|
export function checkoutRequestToJSON(
|
|
219
110
|
checkoutRequest: CheckoutRequest,
|
|
220
111
|
): string {
|
|
221
112
|
return JSON.stringify(CheckoutRequest$outboundSchema.parse(checkoutRequest));
|
|
222
113
|
}
|
|
223
|
-
|
|
224
|
-
export function checkoutRequestFromJSON(
|
|
225
|
-
jsonString: string,
|
|
226
|
-
): SafeParseResult<CheckoutRequest, SDKValidationError> {
|
|
227
|
-
return safeParse(
|
|
228
|
-
jsonString,
|
|
229
|
-
(x) => CheckoutRequest$inboundSchema.parse(JSON.parse(x)),
|
|
230
|
-
`Failed to parse 'CheckoutRequest' from JSON`,
|
|
231
|
-
);
|
|
232
|
-
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
@@ -28,48 +28,6 @@ export const CheckoutResponse$inboundSchema: z.ZodType<
|
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
/** @internal */
|
|
32
|
-
export type CheckoutResponse$Outbound = {
|
|
33
|
-
checkout_id?: string | undefined;
|
|
34
|
-
checkout_url?: string | undefined;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** @internal */
|
|
38
|
-
export const CheckoutResponse$outboundSchema: z.ZodType<
|
|
39
|
-
CheckoutResponse$Outbound,
|
|
40
|
-
z.ZodTypeDef,
|
|
41
|
-
CheckoutResponse
|
|
42
|
-
> = z.object({
|
|
43
|
-
checkoutId: z.string().optional(),
|
|
44
|
-
checkoutUrl: z.string().optional(),
|
|
45
|
-
}).transform((v) => {
|
|
46
|
-
return remap$(v, {
|
|
47
|
-
checkoutId: "checkout_id",
|
|
48
|
-
checkoutUrl: "checkout_url",
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @internal
|
|
54
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
|
-
*/
|
|
56
|
-
export namespace CheckoutResponse$ {
|
|
57
|
-
/** @deprecated use `CheckoutResponse$inboundSchema` instead. */
|
|
58
|
-
export const inboundSchema = CheckoutResponse$inboundSchema;
|
|
59
|
-
/** @deprecated use `CheckoutResponse$outboundSchema` instead. */
|
|
60
|
-
export const outboundSchema = CheckoutResponse$outboundSchema;
|
|
61
|
-
/** @deprecated use `CheckoutResponse$Outbound` instead. */
|
|
62
|
-
export type Outbound = CheckoutResponse$Outbound;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function checkoutResponseToJSON(
|
|
66
|
-
checkoutResponse: CheckoutResponse,
|
|
67
|
-
): string {
|
|
68
|
-
return JSON.stringify(
|
|
69
|
-
CheckoutResponse$outboundSchema.parse(checkoutResponse),
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
31
|
export function checkoutResponseFromJSON(
|
|
74
32
|
jsonString: string,
|
|
75
33
|
): SafeParseResult<CheckoutResponse, SDKValidationError> {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
6
|
import { CrevioError } from "./crevioerror.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -55,34 +55,3 @@ export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
|
|
|
55
55
|
body: v.body$,
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
|
-
|
|
59
|
-
/** @internal */
|
|
60
|
-
export type ErrorT$Outbound = {
|
|
61
|
-
error?: string | undefined;
|
|
62
|
-
details?: Array<string> | undefined;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/** @internal */
|
|
66
|
-
export const ErrorT$outboundSchema: z.ZodType<
|
|
67
|
-
ErrorT$Outbound,
|
|
68
|
-
z.ZodTypeDef,
|
|
69
|
-
ErrorT
|
|
70
|
-
> = z.instanceof(ErrorT)
|
|
71
|
-
.transform(v => v.data$)
|
|
72
|
-
.pipe(z.object({
|
|
73
|
-
error: z.string().optional(),
|
|
74
|
-
details: z.array(z.string()).optional(),
|
|
75
|
-
}));
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @internal
|
|
79
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
80
|
-
*/
|
|
81
|
-
export namespace ErrorT$ {
|
|
82
|
-
/** @deprecated use `ErrorT$inboundSchema` instead. */
|
|
83
|
-
export const inboundSchema = ErrorT$inboundSchema;
|
|
84
|
-
/** @deprecated use `ErrorT$outboundSchema` instead. */
|
|
85
|
-
export const outboundSchema = ErrorT$outboundSchema;
|
|
86
|
-
/** @deprecated use `ErrorT$Outbound` instead. */
|
|
87
|
-
export type Outbound = ErrorT$Outbound;
|
|
88
|
-
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
@@ -34,50 +34,6 @@ export const FileAttachment$inboundSchema: z.ZodType<
|
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
/** @internal */
|
|
38
|
-
export type FileAttachment$Outbound = {
|
|
39
|
-
id?: number | undefined;
|
|
40
|
-
filename?: string | undefined;
|
|
41
|
-
content_type?: string | undefined;
|
|
42
|
-
byte_size?: number | undefined;
|
|
43
|
-
url?: string | undefined;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/** @internal */
|
|
47
|
-
export const FileAttachment$outboundSchema: z.ZodType<
|
|
48
|
-
FileAttachment$Outbound,
|
|
49
|
-
z.ZodTypeDef,
|
|
50
|
-
FileAttachment
|
|
51
|
-
> = z.object({
|
|
52
|
-
id: z.number().int().optional(),
|
|
53
|
-
filename: z.string().optional(),
|
|
54
|
-
contentType: z.string().optional(),
|
|
55
|
-
byteSize: z.number().int().optional(),
|
|
56
|
-
url: z.string().optional(),
|
|
57
|
-
}).transform((v) => {
|
|
58
|
-
return remap$(v, {
|
|
59
|
-
contentType: "content_type",
|
|
60
|
-
byteSize: "byte_size",
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @internal
|
|
66
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
67
|
-
*/
|
|
68
|
-
export namespace FileAttachment$ {
|
|
69
|
-
/** @deprecated use `FileAttachment$inboundSchema` instead. */
|
|
70
|
-
export const inboundSchema = FileAttachment$inboundSchema;
|
|
71
|
-
/** @deprecated use `FileAttachment$outboundSchema` instead. */
|
|
72
|
-
export const outboundSchema = FileAttachment$outboundSchema;
|
|
73
|
-
/** @deprecated use `FileAttachment$Outbound` instead. */
|
|
74
|
-
export type Outbound = FileAttachment$Outbound;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function fileAttachmentToJSON(fileAttachment: FileAttachment): string {
|
|
78
|
-
return JSON.stringify(FileAttachment$outboundSchema.parse(fileAttachment));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
37
|
export function fileAttachmentFromJSON(
|
|
82
38
|
jsonString: string,
|
|
83
39
|
): SafeParseResult<FileAttachment, SDKValidationError> {
|