@paynow-gg/typescript-sdk 1.0.1 → 1.0.5
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 +4 -4
- package/dist/client.d.ts +71 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +51 -0
- package/dist/client.js.map +1 -0
- package/dist/generate.d.ts +2 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +97 -0
- package/dist/generate.js.map +1 -0
- package/dist/generated/management.d.ts +9173 -0
- package/dist/generated/management.d.ts.map +1 -0
- package/dist/generated/management.js +510 -0
- package/dist/generated/management.js.map +1 -0
- package/dist/generated/storefront.d.ts +1660 -0
- package/dist/generated/storefront.d.ts.map +1 -0
- package/dist/generated/storefront.js +62 -0
- package/dist/generated/storefront.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/management.d.ts +6 -21
- package/dist/management.d.ts.map +1 -1
- package/dist/management.js +8 -58
- package/dist/management.js.map +1 -1
- package/dist/storefront.d.ts +6 -20
- package/dist/storefront.d.ts.map +1 -1
- package/dist/storefront.js +9 -59
- package/dist/storefront.js.map +1 -1
- package/package.json +5 -4
- package/dist/base-api.d.ts +0 -58
- package/dist/base-api.d.ts.map +0 -1
- package/dist/base-api.js +0 -103
- package/dist/base-api.js.map +0 -1
- package/dist/management-client/client/client.d.ts +0 -3
- package/dist/management-client/client/client.d.ts.map +0 -1
- package/dist/management-client/client/client.js +0 -100
- package/dist/management-client/client/client.js.map +0 -1
- package/dist/management-client/client/index.d.ts +0 -8
- package/dist/management-client/client/index.d.ts.map +0 -1
- package/dist/management-client/client/index.js +0 -14
- package/dist/management-client/client/index.js.map +0 -1
- package/dist/management-client/client/types.d.ts +0 -94
- package/dist/management-client/client/types.d.ts.map +0 -1
- package/dist/management-client/client/types.js +0 -3
- package/dist/management-client/client/types.js.map +0 -1
- package/dist/management-client/client/utils.d.ts +0 -21
- package/dist/management-client/client/utils.d.ts.map +0 -1
- package/dist/management-client/client/utils.js +0 -226
- package/dist/management-client/client/utils.js.map +0 -1
- package/dist/management-client/client.gen.d.ts +0 -13
- package/dist/management-client/client.gen.d.ts.map +0 -1
- package/dist/management-client/client.gen.js +0 -9
- package/dist/management-client/client.gen.js.map +0 -1
- package/dist/management-client/core/auth.d.ts +0 -19
- package/dist/management-client/core/auth.d.ts.map +0 -1
- package/dist/management-client/core/auth.js +0 -18
- package/dist/management-client/core/auth.js.map +0 -1
- package/dist/management-client/core/bodySerializer.d.ts +0 -18
- package/dist/management-client/core/bodySerializer.d.ts.map +0 -1
- package/dist/management-client/core/bodySerializer.js +0 -57
- package/dist/management-client/core/bodySerializer.js.map +0 -1
- package/dist/management-client/core/params.d.ts +0 -24
- package/dist/management-client/core/params.d.ts.map +0 -1
- package/dist/management-client/core/params.js +0 -92
- package/dist/management-client/core/params.js.map +0 -1
- package/dist/management-client/core/pathSerializer.d.ts +0 -34
- package/dist/management-client/core/pathSerializer.d.ts.map +0 -1
- package/dist/management-client/core/pathSerializer.js +0 -123
- package/dist/management-client/core/pathSerializer.js.map +0 -1
- package/dist/management-client/core/types.d.ts +0 -74
- package/dist/management-client/core/types.d.ts.map +0 -1
- package/dist/management-client/core/types.js +0 -3
- package/dist/management-client/core/types.js.map +0 -1
- package/dist/management-client/index.d.ts +0 -3
- package/dist/management-client/index.d.ts.map +0 -1
- package/dist/management-client/index.js +0 -20
- package/dist/management-client/index.js.map +0 -1
- package/dist/management-client/sdk.gen.d.ts +0 -482
- package/dist/management-client/sdk.gen.d.ts.map +0 -1
- package/dist/management-client/sdk.gen.js +0 -2169
- package/dist/management-client/sdk.gen.js.map +0 -1
- package/dist/management-client/types.gen.d.ts +0 -6676
- package/dist/management-client/types.gen.d.ts.map +0 -1
- package/dist/management-client/types.gen.js +0 -380
- package/dist/management-client/types.gen.js.map +0 -1
- package/dist/storefront-client/client/client.d.ts +0 -3
- package/dist/storefront-client/client/client.d.ts.map +0 -1
- package/dist/storefront-client/client/client.js +0 -100
- package/dist/storefront-client/client/client.js.map +0 -1
- package/dist/storefront-client/client/index.d.ts +0 -8
- package/dist/storefront-client/client/index.d.ts.map +0 -1
- package/dist/storefront-client/client/index.js +0 -14
- package/dist/storefront-client/client/index.js.map +0 -1
- package/dist/storefront-client/client/types.d.ts +0 -94
- package/dist/storefront-client/client/types.d.ts.map +0 -1
- package/dist/storefront-client/client/types.js +0 -3
- package/dist/storefront-client/client/types.js.map +0 -1
- package/dist/storefront-client/client/utils.d.ts +0 -21
- package/dist/storefront-client/client/utils.d.ts.map +0 -1
- package/dist/storefront-client/client/utils.js +0 -226
- package/dist/storefront-client/client/utils.js.map +0 -1
- package/dist/storefront-client/client.gen.d.ts +0 -13
- package/dist/storefront-client/client.gen.d.ts.map +0 -1
- package/dist/storefront-client/client.gen.js +0 -9
- package/dist/storefront-client/client.gen.js.map +0 -1
- package/dist/storefront-client/core/auth.d.ts +0 -19
- package/dist/storefront-client/core/auth.d.ts.map +0 -1
- package/dist/storefront-client/core/auth.js +0 -18
- package/dist/storefront-client/core/auth.js.map +0 -1
- package/dist/storefront-client/core/bodySerializer.d.ts +0 -18
- package/dist/storefront-client/core/bodySerializer.d.ts.map +0 -1
- package/dist/storefront-client/core/bodySerializer.js +0 -57
- package/dist/storefront-client/core/bodySerializer.js.map +0 -1
- package/dist/storefront-client/core/params.d.ts +0 -24
- package/dist/storefront-client/core/params.d.ts.map +0 -1
- package/dist/storefront-client/core/params.js +0 -92
- package/dist/storefront-client/core/params.js.map +0 -1
- package/dist/storefront-client/core/pathSerializer.d.ts +0 -34
- package/dist/storefront-client/core/pathSerializer.d.ts.map +0 -1
- package/dist/storefront-client/core/pathSerializer.js +0 -123
- package/dist/storefront-client/core/pathSerializer.js.map +0 -1
- package/dist/storefront-client/core/types.d.ts +0 -74
- package/dist/storefront-client/core/types.d.ts.map +0 -1
- package/dist/storefront-client/core/types.js +0 -3
- package/dist/storefront-client/core/types.js.map +0 -1
- package/dist/storefront-client/index.d.ts +0 -3
- package/dist/storefront-client/index.d.ts.map +0 -1
- package/dist/storefront-client/index.js +0 -20
- package/dist/storefront-client/index.js.map +0 -1
- package/dist/storefront-client/sdk.gen.d.ts +0 -100
- package/dist/storefront-client/sdk.gen.d.ts.map +0 -1
- package/dist/storefront-client/sdk.gen.js +0 -296
- package/dist/storefront-client/sdk.gen.js.map +0 -1
- package/dist/storefront-client/types.gen.d.ts +0 -1410
- package/dist/storefront-client/types.gen.d.ts.map +0 -1
- package/dist/storefront-client/types.gen.js +0 -58
- package/dist/storefront-client/types.gen.js.map +0 -1
- package/dist/types.d.ts +0 -49
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -9
- package/dist/types.js.map +0 -1
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serializeObjectParam = exports.serializePrimitiveParam = exports.serializeArrayParam = exports.separatorObjectExplode = exports.separatorArrayNoExplode = exports.separatorArrayExplode = void 0;
|
|
4
|
-
const separatorArrayExplode = (style) => {
|
|
5
|
-
switch (style) {
|
|
6
|
-
case 'label':
|
|
7
|
-
return '.';
|
|
8
|
-
case 'matrix':
|
|
9
|
-
return ';';
|
|
10
|
-
case 'simple':
|
|
11
|
-
return ',';
|
|
12
|
-
default:
|
|
13
|
-
return '&';
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
exports.separatorArrayExplode = separatorArrayExplode;
|
|
17
|
-
const separatorArrayNoExplode = (style) => {
|
|
18
|
-
switch (style) {
|
|
19
|
-
case 'form':
|
|
20
|
-
return ',';
|
|
21
|
-
case 'pipeDelimited':
|
|
22
|
-
return '|';
|
|
23
|
-
case 'spaceDelimited':
|
|
24
|
-
return '%20';
|
|
25
|
-
default:
|
|
26
|
-
return ',';
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
exports.separatorArrayNoExplode = separatorArrayNoExplode;
|
|
30
|
-
const separatorObjectExplode = (style) => {
|
|
31
|
-
switch (style) {
|
|
32
|
-
case 'label':
|
|
33
|
-
return '.';
|
|
34
|
-
case 'matrix':
|
|
35
|
-
return ';';
|
|
36
|
-
case 'simple':
|
|
37
|
-
return ',';
|
|
38
|
-
default:
|
|
39
|
-
return '&';
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.separatorObjectExplode = separatorObjectExplode;
|
|
43
|
-
const serializeArrayParam = ({ allowReserved, explode, name, style, value, }) => {
|
|
44
|
-
if (!explode) {
|
|
45
|
-
const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join((0, exports.separatorArrayNoExplode)(style));
|
|
46
|
-
switch (style) {
|
|
47
|
-
case 'label':
|
|
48
|
-
return `.${joinedValues}`;
|
|
49
|
-
case 'matrix':
|
|
50
|
-
return `;${name}=${joinedValues}`;
|
|
51
|
-
case 'simple':
|
|
52
|
-
return joinedValues;
|
|
53
|
-
default:
|
|
54
|
-
return `${name}=${joinedValues}`;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const separator = (0, exports.separatorArrayExplode)(style);
|
|
58
|
-
const joinedValues = value
|
|
59
|
-
.map((v) => {
|
|
60
|
-
if (style === 'label' || style === 'simple') {
|
|
61
|
-
return allowReserved ? v : encodeURIComponent(v);
|
|
62
|
-
}
|
|
63
|
-
return (0, exports.serializePrimitiveParam)({
|
|
64
|
-
allowReserved,
|
|
65
|
-
name,
|
|
66
|
-
value: v,
|
|
67
|
-
});
|
|
68
|
-
})
|
|
69
|
-
.join(separator);
|
|
70
|
-
return style === 'label' || style === 'matrix'
|
|
71
|
-
? separator + joinedValues
|
|
72
|
-
: joinedValues;
|
|
73
|
-
};
|
|
74
|
-
exports.serializeArrayParam = serializeArrayParam;
|
|
75
|
-
const serializePrimitiveParam = ({ allowReserved, name, value, }) => {
|
|
76
|
-
if (value === undefined || value === null) {
|
|
77
|
-
return '';
|
|
78
|
-
}
|
|
79
|
-
if (typeof value === 'object') {
|
|
80
|
-
throw new Error('Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.');
|
|
81
|
-
}
|
|
82
|
-
return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
|
|
83
|
-
};
|
|
84
|
-
exports.serializePrimitiveParam = serializePrimitiveParam;
|
|
85
|
-
const serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly, }) => {
|
|
86
|
-
if (value instanceof Date) {
|
|
87
|
-
return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
|
|
88
|
-
}
|
|
89
|
-
if (style !== 'deepObject' && !explode) {
|
|
90
|
-
let values = [];
|
|
91
|
-
Object.entries(value).forEach(([key, v]) => {
|
|
92
|
-
values = [
|
|
93
|
-
...values,
|
|
94
|
-
key,
|
|
95
|
-
allowReserved ? v : encodeURIComponent(v),
|
|
96
|
-
];
|
|
97
|
-
});
|
|
98
|
-
const joinedValues = values.join(',');
|
|
99
|
-
switch (style) {
|
|
100
|
-
case 'form':
|
|
101
|
-
return `${name}=${joinedValues}`;
|
|
102
|
-
case 'label':
|
|
103
|
-
return `.${joinedValues}`;
|
|
104
|
-
case 'matrix':
|
|
105
|
-
return `;${name}=${joinedValues}`;
|
|
106
|
-
default:
|
|
107
|
-
return joinedValues;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const separator = (0, exports.separatorObjectExplode)(style);
|
|
111
|
-
const joinedValues = Object.entries(value)
|
|
112
|
-
.map(([key, v]) => (0, exports.serializePrimitiveParam)({
|
|
113
|
-
allowReserved,
|
|
114
|
-
name: style === 'deepObject' ? `${name}[${key}]` : key,
|
|
115
|
-
value: v,
|
|
116
|
-
}))
|
|
117
|
-
.join(separator);
|
|
118
|
-
return style === 'label' || style === 'matrix'
|
|
119
|
-
? separator + joinedValues
|
|
120
|
-
: joinedValues;
|
|
121
|
-
};
|
|
122
|
-
exports.serializeObjectParam = serializeObjectParam;
|
|
123
|
-
//# sourceMappingURL=pathSerializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pathSerializer.js","sourceRoot":"","sources":["../../../src/storefront-client/core/pathSerializer.ts"],"names":[],"mappings":";;;AA2BO,MAAM,qBAAqB,GAAG,CAAC,KAA0B,EAAE,EAAE;IAClE,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,GAAG,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,qBAAqB,yBAWhC;AAEK,MAAM,uBAAuB,GAAG,CAAC,KAA0B,EAAE,EAAE;IACpE,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb,KAAK,eAAe;YAClB,OAAO,GAAG,CAAC;QACb,KAAK,gBAAgB;YACnB,OAAO,KAAK,CAAC;QACf;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,uBAAuB,2BAWlC;AAEK,MAAM,sBAAsB,GAAG,CAAC,KAA2B,EAAE,EAAE;IACpE,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,GAAG,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,sBAAsB,0BAWjC;AAEK,MAAM,mBAAmB,GAAG,CAAC,EAClC,aAAa,EACb,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,GAGN,EAAE,EAAE;IACH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,YAAY,GAAG,CACnB,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KA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YAAY,EAAE,CAAC;YACpC;gBACE,OAAO,YAAY,CAAC;QACxB,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,8BAAsB,EAAC,KAAK,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACvC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAChB,IAAA,+BAAuB,EAAC;QACtB,aAAa;QACb,IAAI,EAAE,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG;QACtD,KAAK,EAAE,CAAW;KACnB,CAAC,CACH;SACA,IAAI,CAAC,SAAS,CAAC,CAAC;IACnB,OAAO,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ;QAC5C,CAAC,CAAC,SAAS,GAAG,YAAY;QAC1B,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC,CAAC;AAlDW,QAAA,oBAAoB,wBAkD/B"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { Auth, AuthToken } from './auth';
|
|
2
|
-
import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer';
|
|
3
|
-
export interface Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
|
|
4
|
-
/**
|
|
5
|
-
* Returns the final request URL.
|
|
6
|
-
*/
|
|
7
|
-
buildUrl: BuildUrlFn;
|
|
8
|
-
connect: MethodFn;
|
|
9
|
-
delete: MethodFn;
|
|
10
|
-
get: MethodFn;
|
|
11
|
-
getConfig: () => Config;
|
|
12
|
-
head: MethodFn;
|
|
13
|
-
options: MethodFn;
|
|
14
|
-
patch: MethodFn;
|
|
15
|
-
post: MethodFn;
|
|
16
|
-
put: MethodFn;
|
|
17
|
-
request: RequestFn;
|
|
18
|
-
setConfig: (config: Config) => Config;
|
|
19
|
-
trace: MethodFn;
|
|
20
|
-
}
|
|
21
|
-
export interface Config {
|
|
22
|
-
/**
|
|
23
|
-
* Auth token or a function returning auth token. The resolved value will be
|
|
24
|
-
* added to the request payload as defined by its `security` array.
|
|
25
|
-
*/
|
|
26
|
-
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
27
|
-
/**
|
|
28
|
-
* A function for serializing request body parameter. By default,
|
|
29
|
-
* {@link JSON.stringify()} will be used.
|
|
30
|
-
*/
|
|
31
|
-
bodySerializer?: BodySerializer | null;
|
|
32
|
-
/**
|
|
33
|
-
* An object containing any HTTP headers that you want to pre-populate your
|
|
34
|
-
* `Headers` object with.
|
|
35
|
-
*
|
|
36
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
37
|
-
*/
|
|
38
|
-
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
39
|
-
/**
|
|
40
|
-
* The request method.
|
|
41
|
-
*
|
|
42
|
-
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
43
|
-
*/
|
|
44
|
-
method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
45
|
-
/**
|
|
46
|
-
* A function for serializing request query parameters. By default, arrays
|
|
47
|
-
* will be exploded in form style, objects will be exploded in deepObject
|
|
48
|
-
* style, and reserved characters are percent-encoded.
|
|
49
|
-
*
|
|
50
|
-
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
51
|
-
* API function is used.
|
|
52
|
-
*
|
|
53
|
-
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
54
|
-
*/
|
|
55
|
-
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
56
|
-
/**
|
|
57
|
-
* A function validating request data. This is useful if you want to ensure
|
|
58
|
-
* the request conforms to the desired shape, so it can be safely sent to
|
|
59
|
-
* the server.
|
|
60
|
-
*/
|
|
61
|
-
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
62
|
-
/**
|
|
63
|
-
* A function transforming response data before it's returned. This is useful
|
|
64
|
-
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
65
|
-
*/
|
|
66
|
-
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
67
|
-
/**
|
|
68
|
-
* A function validating response data. This is useful if you want to ensure
|
|
69
|
-
* the response conforms to the desired shape, so it can be safely passed to
|
|
70
|
-
* the transformers and returned to the user.
|
|
71
|
-
*/
|
|
72
|
-
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/storefront-client/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,MAAM,CACrB,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,KAAK,EAChB,UAAU,GAAG,KAAK;IAElB;;OAEG;IACH,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,QAAQ,CAAC;IACjB,GAAG,EAAE,QAAQ,CAAC;IACd,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACpE;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC;;;;;OAKG;IACH,OAAO,CAAC,EACJ,WAAW,CAAC,SAAS,CAAC,GACtB,MAAM,CACJ,MAAM,EACJ,MAAM,GACN,MAAM,GACN,OAAO,GACP,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,GAC7B,IAAI,GACJ,SAAS,GACT,OAAO,CACV,CAAC;IACN;;;;OAIG;IACH,MAAM,CAAC,EACH,SAAS,GACT,QAAQ,GACR,KAAK,GACL,MAAM,GACN,SAAS,GACT,OAAO,GACP,MAAM,GACN,KAAK,GACL,OAAO,CAAC;IACZ;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,eAAe,GAAG,sBAAsB,CAAC;IAC3D;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/storefront-client/core/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storefront-client/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
18
|
-
__exportStar(require("./types.gen"), exports);
|
|
19
|
-
__exportStar(require("./sdk.gen"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storefront-client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,8CAA4B;AAC5B,4CAA0B"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { Options as ClientOptions, TDataShape, Client } from './client';
|
|
2
|
-
import type { StorefrontCartClearCartData, StorefrontCartClearCartResponses, StorefrontCartClearCartErrors, StorefrontCartGetCartData, StorefrontCartGetCartResponses, StorefrontCartGetCartErrors, StorefrontCartAddLineData, StorefrontCartAddLineResponses, StorefrontCartAddLineErrors, StorefrontCartCreateCartCheckoutData, StorefrontCartCreateCartCheckoutResponses, StorefrontCartCreateCartCheckoutErrors, StorefrontCheckoutCreateCheckoutSessionData, StorefrontCheckoutCreateCheckoutSessionResponses, StorefrontCheckoutCreateCheckoutSessionErrors, StorefrontCustomerGetStorefrontCustomerData, StorefrontCustomerGetStorefrontCustomerResponses, StorefrontCustomerGetStorefrontCustomerErrors, StorefrontCustomerGetStorefrontGiftCardData, StorefrontCustomerGetStorefrontGiftCardResponses, StorefrontCustomerGetStorefrontGiftCardErrors, StorefrontCustomerRootGetStorefrontCustomerDeliveryItemsData, StorefrontCustomerRootGetStorefrontCustomerDeliveryItemsResponses, StorefrontCustomerRootGetStorefrontCustomerDeliveryItemsErrors, ProductsDiscordDoProductsHaveDiscordActionsData, ProductsDiscordDoProductsHaveDiscordActionsResponses, ProductsDiscordDoProductsHaveDiscordActionsErrors, StorefrontNavLinksGetStorefrontNavLinksData, StorefrontNavLinksGetStorefrontNavLinksResponses, StorefrontNavLinksGetStorefrontNavLinksErrors, StorefrontProductsGetStorefrontProductsData, StorefrontProductsGetStorefrontProductsResponses, StorefrontProductsGetStorefrontProductsErrors, StorefrontProductsGetStorefrontProductByIdOrSlugData, StorefrontProductsGetStorefrontProductByIdOrSlugResponses, StorefrontProductsGetStorefrontProductByIdOrSlugErrors, StorefrontStoreGetStorefrontStoreData, StorefrontStoreGetStorefrontStoreResponses, StorefrontStoreGetStorefrontStoreErrors, StorefrontTagsGetStorefrontTagsData, StorefrontTagsGetStorefrontTagsResponses, StorefrontTagsGetStorefrontTagsErrors } from './types.gen';
|
|
3
|
-
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
|
-
/**
|
|
5
|
-
* You can provide a client instance returned by `createClient()` instead of
|
|
6
|
-
* individual options. This might be also useful if you want to implement a
|
|
7
|
-
* custom client.
|
|
8
|
-
*/
|
|
9
|
-
client?: Client;
|
|
10
|
-
/**
|
|
11
|
-
* You can pass arbitrary values through the `meta` object. This can be
|
|
12
|
-
* used to access values that aren't defined as part of the SDK function.
|
|
13
|
-
*/
|
|
14
|
-
meta?: Record<string, unknown>;
|
|
15
|
-
};
|
|
16
|
-
export declare class Cart {
|
|
17
|
-
/**
|
|
18
|
-
* Clear cart
|
|
19
|
-
* Clears all items from the customer's shopping cart.
|
|
20
|
-
*/
|
|
21
|
-
static clearCart<ThrowOnError extends boolean = false>(options?: Options<StorefrontCartClearCartData, ThrowOnError>): import("./client").RequestResult<StorefrontCartClearCartResponses, StorefrontCartClearCartErrors, ThrowOnError>;
|
|
22
|
-
/**
|
|
23
|
-
* Get cart
|
|
24
|
-
* Retrieves the current customer's shopping cart.
|
|
25
|
-
*/
|
|
26
|
-
static getCart<ThrowOnError extends boolean = false>(options?: Options<StorefrontCartGetCartData, ThrowOnError>): import("./client").RequestResult<StorefrontCartGetCartResponses, StorefrontCartGetCartErrors, ThrowOnError>;
|
|
27
|
-
/**
|
|
28
|
-
* Add product to cart
|
|
29
|
-
* Adds a product to the cart or updates the quantity of an existing product.
|
|
30
|
-
* When increment parameter is "true" or "1", the specified quantity will be added to any existing quantity.
|
|
31
|
-
* Otherwise, the quantity will be set to the specified value, replacing any existing quantity.
|
|
32
|
-
*/
|
|
33
|
-
static addLine<ThrowOnError extends boolean = false>(options: Options<StorefrontCartAddLineData, ThrowOnError>): import("./client").RequestResult<StorefrontCartAddLineResponses, StorefrontCartAddLineErrors, ThrowOnError>;
|
|
34
|
-
/**
|
|
35
|
-
* Create a cart checkout session
|
|
36
|
-
* Creates a checkout session from the contents of the cart.
|
|
37
|
-
* After creating the checkout session, redirect the customer to the `url` returned.
|
|
38
|
-
*/
|
|
39
|
-
static createCartCheckout<ThrowOnError extends boolean = false>(options?: Options<StorefrontCartCreateCartCheckoutData, ThrowOnError>): import("./client").RequestResult<StorefrontCartCreateCartCheckoutResponses, StorefrontCartCreateCartCheckoutErrors, ThrowOnError>;
|
|
40
|
-
}
|
|
41
|
-
export declare class Checkout {
|
|
42
|
-
/**
|
|
43
|
-
* Create a checkout session
|
|
44
|
-
* Creates a checkout session using a Customer token.
|
|
45
|
-
* After creating the checkout session, redirect the customer to the `url` returned.
|
|
46
|
-
*/
|
|
47
|
-
static createCheckoutSession<ThrowOnError extends boolean = false>(options?: Options<StorefrontCheckoutCreateCheckoutSessionData, ThrowOnError>): import("./client").RequestResult<StorefrontCheckoutCreateCheckoutSessionResponses, StorefrontCheckoutCreateCheckoutSessionErrors, ThrowOnError>;
|
|
48
|
-
}
|
|
49
|
-
export declare class Customer {
|
|
50
|
-
/**
|
|
51
|
-
* Get current customer
|
|
52
|
-
* Retrieves the current customer from the passed Customer token.
|
|
53
|
-
*/
|
|
54
|
-
static getStorefrontCustomer<ThrowOnError extends boolean = false>(options?: Options<StorefrontCustomerGetStorefrontCustomerData, ThrowOnError>): import("./client").RequestResult<StorefrontCustomerGetStorefrontCustomerResponses, StorefrontCustomerGetStorefrontCustomerErrors, ThrowOnError>;
|
|
55
|
-
/**
|
|
56
|
-
* Lookup a gift card by the code
|
|
57
|
-
*/
|
|
58
|
-
static getStorefrontGiftCard<ThrowOnError extends boolean = false>(options: Options<StorefrontCustomerGetStorefrontGiftCardData, ThrowOnError>): import("./client").RequestResult<StorefrontCustomerGetStorefrontGiftCardResponses, StorefrontCustomerGetStorefrontGiftCardErrors, ThrowOnError>;
|
|
59
|
-
/**
|
|
60
|
-
* Get storefront customer delivery items
|
|
61
|
-
*/
|
|
62
|
-
static rootGetStorefrontCustomerDeliveryItems<ThrowOnError extends boolean = false>(options?: Options<StorefrontCustomerRootGetStorefrontCustomerDeliveryItemsData, ThrowOnError>): import("./client").RequestResult<StorefrontCustomerRootGetStorefrontCustomerDeliveryItemsResponses, StorefrontCustomerRootGetStorefrontCustomerDeliveryItemsErrors, ThrowOnError>;
|
|
63
|
-
}
|
|
64
|
-
export declare class Discord {
|
|
65
|
-
static doProductsHaveDiscordActions<ThrowOnError extends boolean = false>(options: Options<ProductsDiscordDoProductsHaveDiscordActionsData, ThrowOnError>): import("./client").RequestResult<ProductsDiscordDoProductsHaveDiscordActionsResponses, ProductsDiscordDoProductsHaveDiscordActionsErrors, ThrowOnError>;
|
|
66
|
-
}
|
|
67
|
-
export declare class Navlinks {
|
|
68
|
-
/**
|
|
69
|
-
* Get navlinks
|
|
70
|
-
* Retrieves the store's navlink structure used for navigation.
|
|
71
|
-
*/
|
|
72
|
-
static getStorefrontNavLinks<ThrowOnError extends boolean = false>(options: Options<StorefrontNavLinksGetStorefrontNavLinksData, ThrowOnError>): import("./client").RequestResult<StorefrontNavLinksGetStorefrontNavLinksResponses, StorefrontNavLinksGetStorefrontNavLinksErrors, ThrowOnError>;
|
|
73
|
-
}
|
|
74
|
-
export declare class Products {
|
|
75
|
-
/**
|
|
76
|
-
* Get products
|
|
77
|
-
* Retrieves the available products. To make sure all VAT rates are properly displayed, pass in the IP headers as instructed.
|
|
78
|
-
*/
|
|
79
|
-
static getStorefrontProducts<ThrowOnError extends boolean = false>(options: Options<StorefrontProductsGetStorefrontProductsData, ThrowOnError>): import("./client").RequestResult<StorefrontProductsGetStorefrontProductsResponses, StorefrontProductsGetStorefrontProductsErrors, ThrowOnError>;
|
|
80
|
-
/**
|
|
81
|
-
* Get product by ID or slug
|
|
82
|
-
* Retrieves a product by an ID or a slug. To make sure all VAT rates are properly displayed, pass in the IP headers as instructed.
|
|
83
|
-
*/
|
|
84
|
-
static getStorefrontProductByIdOrSlug<ThrowOnError extends boolean = false>(options: Options<StorefrontProductsGetStorefrontProductByIdOrSlugData, ThrowOnError>): import("./client").RequestResult<StorefrontProductsGetStorefrontProductByIdOrSlugResponses, StorefrontProductsGetStorefrontProductByIdOrSlugErrors, ThrowOnError>;
|
|
85
|
-
}
|
|
86
|
-
export declare class Store {
|
|
87
|
-
/**
|
|
88
|
-
* Get current store
|
|
89
|
-
* Retrieves a store by the passed in x-paynow-store-id or Customer token.
|
|
90
|
-
*/
|
|
91
|
-
static getStorefrontStore<ThrowOnError extends boolean = false>(options: Options<StorefrontStoreGetStorefrontStoreData, ThrowOnError>): import("./client").RequestResult<StorefrontStoreGetStorefrontStoreResponses, StorefrontStoreGetStorefrontStoreErrors, ThrowOnError>;
|
|
92
|
-
}
|
|
93
|
-
export declare class Tags {
|
|
94
|
-
/**
|
|
95
|
-
* Get tags
|
|
96
|
-
* Retrieves the store's tags.
|
|
97
|
-
*/
|
|
98
|
-
static getStorefrontTags<ThrowOnError extends boolean = false>(options: Options<StorefrontTagsGetStorefrontTagsData, ThrowOnError>): import("./client").RequestResult<StorefrontTagsGetStorefrontTagsResponses, StorefrontTagsGetStorefrontTagsErrors, ThrowOnError>;
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=sdk.gen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.gen.d.ts","sourceRoot":"","sources":["../../src/storefront-client/sdk.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,2BAA2B,EAAE,gCAAgC,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,oCAAoC,EAAE,yCAAyC,EAAE,sCAAsC,EAAE,2CAA2C,EAAE,gDAAgD,EAAE,6CAA6C,EAAE,2CAA2C,EAAE,gDAAgD,EAAE,6CAA6C,EAAE,2CAA2C,EAAE,gDAAgD,EAAE,6CAA6C,EAAE,4DAA4D,EAAE,iEAAiE,EAAE,8DAA8D,EAAE,+CAA+C,EAAE,oDAAoD,EAAE,iDAAiD,EAAE,2CAA2C,EAAE,gDAAgD,EAAE,6CAA6C,EAAE,2CAA2C,EAAE,gDAAgD,EAAE,6CAA6C,EAAE,oDAAoD,EAAE,yDAAyD,EAAE,sDAAsD,EAAE,qCAAqC,EAAE,0CAA0C,EAAE,uCAAuC,EAAE,mCAAmC,EAAE,wCAAwC,EAAE,qCAAqC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CAA2C,EAAE,YAAY,CAAC;IAcrJ;;OAEG;WACW,sCAAsC,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,4DAA4D,EAAE,YAAY,CAAC;CAa3L;AAED,qBAAa,OAAO;WACF,4BAA4B,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,+CAA+C,EAAE,YAAY,CAAC;CAiBnK;AAED,qBAAa,QAAQ;IACjB;;;OAGG;WACW,qBAAqB,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,2CAA2C,EAAE,YAAY,CAAC;CAiBxJ;AAED,qBAAa,QAAQ;IACjB;;;OAGG;WACW,qBAAqB,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,2CAA2C,EAAE,YAAY,CAAC;IAkBrJ;;;OAGG;WACW,8BAA8B,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,oDAAoD,EAAE,YAAY,CAAC;CAiB1K;AAED,qBAAa,KAAK;IACd;;;OAGG;WACW,kBAAkB,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,qCAAqC,EAAE,YAAY,CAAC;CAiB/I;AAED,qBAAa,IAAI;IACb;;;OAGG;WACW,iBAAiB,CAAC,YAAY,SAAS,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,mCAAmC,EAAE,YAAY,CAAC;CAiB5I"}
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Tags = exports.Store = exports.Products = exports.Navlinks = exports.Discord = exports.Customer = exports.Checkout = exports.Cart = void 0;
|
|
5
|
-
const client_gen_1 = require("./client.gen");
|
|
6
|
-
class Cart {
|
|
7
|
-
/**
|
|
8
|
-
* Clear cart
|
|
9
|
-
* Clears all items from the customer's shopping cart.
|
|
10
|
-
*/
|
|
11
|
-
static clearCart(options) {
|
|
12
|
-
return (options?.client ?? client_gen_1.client).delete({
|
|
13
|
-
security: [
|
|
14
|
-
{
|
|
15
|
-
name: 'Authorization',
|
|
16
|
-
type: 'apiKey'
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
url: '/v1/store/cart',
|
|
20
|
-
...options
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Get cart
|
|
25
|
-
* Retrieves the current customer's shopping cart.
|
|
26
|
-
*/
|
|
27
|
-
static getCart(options) {
|
|
28
|
-
return (options?.client ?? client_gen_1.client).get({
|
|
29
|
-
responseType: 'json',
|
|
30
|
-
security: [
|
|
31
|
-
{
|
|
32
|
-
name: 'Authorization',
|
|
33
|
-
type: 'apiKey'
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
url: '/v1/store/cart',
|
|
37
|
-
...options
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Add product to cart
|
|
42
|
-
* Adds a product to the cart or updates the quantity of an existing product.
|
|
43
|
-
* When increment parameter is "true" or "1", the specified quantity will be added to any existing quantity.
|
|
44
|
-
* Otherwise, the quantity will be set to the specified value, replacing any existing quantity.
|
|
45
|
-
*/
|
|
46
|
-
static addLine(options) {
|
|
47
|
-
return (options.client ?? client_gen_1.client).put({
|
|
48
|
-
security: [
|
|
49
|
-
{
|
|
50
|
-
name: 'Authorization',
|
|
51
|
-
type: 'apiKey'
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
url: '/v1/store/cart/lines',
|
|
55
|
-
...options
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Create a cart checkout session
|
|
60
|
-
* Creates a checkout session from the contents of the cart.
|
|
61
|
-
* After creating the checkout session, redirect the customer to the `url` returned.
|
|
62
|
-
*/
|
|
63
|
-
static createCartCheckout(options) {
|
|
64
|
-
return (options?.client ?? client_gen_1.client).post({
|
|
65
|
-
responseType: 'json',
|
|
66
|
-
security: [
|
|
67
|
-
{
|
|
68
|
-
name: 'Authorization',
|
|
69
|
-
type: 'apiKey'
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
url: '/v1/store/cart/checkout',
|
|
73
|
-
...options,
|
|
74
|
-
headers: {
|
|
75
|
-
'Content-Type': 'application/json',
|
|
76
|
-
...options?.headers
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.Cart = Cart;
|
|
82
|
-
class Checkout {
|
|
83
|
-
/**
|
|
84
|
-
* Create a checkout session
|
|
85
|
-
* Creates a checkout session using a Customer token.
|
|
86
|
-
* After creating the checkout session, redirect the customer to the `url` returned.
|
|
87
|
-
*/
|
|
88
|
-
static createCheckoutSession(options) {
|
|
89
|
-
return (options?.client ?? client_gen_1.client).post({
|
|
90
|
-
responseType: 'json',
|
|
91
|
-
security: [
|
|
92
|
-
{
|
|
93
|
-
name: 'Authorization',
|
|
94
|
-
type: 'apiKey'
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
url: '/v1/checkouts',
|
|
98
|
-
...options,
|
|
99
|
-
headers: {
|
|
100
|
-
'Content-Type': 'application/json',
|
|
101
|
-
...options?.headers
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.Checkout = Checkout;
|
|
107
|
-
class Customer {
|
|
108
|
-
/**
|
|
109
|
-
* Get current customer
|
|
110
|
-
* Retrieves the current customer from the passed Customer token.
|
|
111
|
-
*/
|
|
112
|
-
static getStorefrontCustomer(options) {
|
|
113
|
-
return (options?.client ?? client_gen_1.client).get({
|
|
114
|
-
responseType: 'json',
|
|
115
|
-
security: [
|
|
116
|
-
{
|
|
117
|
-
name: 'Authorization',
|
|
118
|
-
type: 'apiKey'
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
url: '/v1/store/customer',
|
|
122
|
-
...options
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Lookup a gift card by the code
|
|
127
|
-
*/
|
|
128
|
-
static getStorefrontGiftCard(options) {
|
|
129
|
-
return (options.client ?? client_gen_1.client).get({
|
|
130
|
-
responseType: 'json',
|
|
131
|
-
security: [
|
|
132
|
-
{
|
|
133
|
-
name: 'Authorization',
|
|
134
|
-
type: 'apiKey'
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
url: '/v1/store/customer/giftcards/lookup/{code}',
|
|
138
|
-
...options
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Get storefront customer delivery items
|
|
143
|
-
*/
|
|
144
|
-
static rootGetStorefrontCustomerDeliveryItems(options) {
|
|
145
|
-
return (options?.client ?? client_gen_1.client).get({
|
|
146
|
-
responseType: 'json',
|
|
147
|
-
security: [
|
|
148
|
-
{
|
|
149
|
-
name: 'Authorization',
|
|
150
|
-
type: 'apiKey'
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
url: '/v1/store/customer/command-delivery',
|
|
154
|
-
...options
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
exports.Customer = Customer;
|
|
159
|
-
class Discord {
|
|
160
|
-
static doProductsHaveDiscordActions(options) {
|
|
161
|
-
return (options.client ?? client_gen_1.client).get({
|
|
162
|
-
responseType: 'json',
|
|
163
|
-
security: [
|
|
164
|
-
{
|
|
165
|
-
name: 'Authorization',
|
|
166
|
-
type: 'apiKey'
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'Authorization',
|
|
170
|
-
type: 'apiKey'
|
|
171
|
-
}
|
|
172
|
-
],
|
|
173
|
-
url: '/v1/stores/{storeId}/product_versions/discord_actions',
|
|
174
|
-
...options
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
exports.Discord = Discord;
|
|
179
|
-
class Navlinks {
|
|
180
|
-
/**
|
|
181
|
-
* Get navlinks
|
|
182
|
-
* Retrieves the store's navlink structure used for navigation.
|
|
183
|
-
*/
|
|
184
|
-
static getStorefrontNavLinks(options) {
|
|
185
|
-
return (options.client ?? client_gen_1.client).get({
|
|
186
|
-
responseType: 'json',
|
|
187
|
-
security: [
|
|
188
|
-
{
|
|
189
|
-
name: 'Authorization',
|
|
190
|
-
type: 'apiKey'
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
name: 'Authorization',
|
|
194
|
-
type: 'apiKey'
|
|
195
|
-
}
|
|
196
|
-
],
|
|
197
|
-
url: '/v1/store/navlinks',
|
|
198
|
-
...options
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
exports.Navlinks = Navlinks;
|
|
203
|
-
class Products {
|
|
204
|
-
/**
|
|
205
|
-
* Get products
|
|
206
|
-
* Retrieves the available products. To make sure all VAT rates are properly displayed, pass in the IP headers as instructed.
|
|
207
|
-
*/
|
|
208
|
-
static getStorefrontProducts(options) {
|
|
209
|
-
return (options.client ?? client_gen_1.client).get({
|
|
210
|
-
responseType: 'json',
|
|
211
|
-
security: [
|
|
212
|
-
{
|
|
213
|
-
name: 'Authorization',
|
|
214
|
-
type: 'apiKey'
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: 'Authorization',
|
|
218
|
-
type: 'apiKey'
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
url: '/v1/store/products',
|
|
222
|
-
...options
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Get product by ID or slug
|
|
227
|
-
* Retrieves a product by an ID or a slug. To make sure all VAT rates are properly displayed, pass in the IP headers as instructed.
|
|
228
|
-
*/
|
|
229
|
-
static getStorefrontProductByIdOrSlug(options) {
|
|
230
|
-
return (options.client ?? client_gen_1.client).get({
|
|
231
|
-
responseType: 'json',
|
|
232
|
-
security: [
|
|
233
|
-
{
|
|
234
|
-
name: 'Authorization',
|
|
235
|
-
type: 'apiKey'
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
name: 'Authorization',
|
|
239
|
-
type: 'apiKey'
|
|
240
|
-
}
|
|
241
|
-
],
|
|
242
|
-
url: '/v1/store/products/{idOrSlug}',
|
|
243
|
-
...options
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
exports.Products = Products;
|
|
248
|
-
class Store {
|
|
249
|
-
/**
|
|
250
|
-
* Get current store
|
|
251
|
-
* Retrieves a store by the passed in x-paynow-store-id or Customer token.
|
|
252
|
-
*/
|
|
253
|
-
static getStorefrontStore(options) {
|
|
254
|
-
return (options.client ?? client_gen_1.client).get({
|
|
255
|
-
responseType: 'json',
|
|
256
|
-
security: [
|
|
257
|
-
{
|
|
258
|
-
name: 'Authorization',
|
|
259
|
-
type: 'apiKey'
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
name: 'Authorization',
|
|
263
|
-
type: 'apiKey'
|
|
264
|
-
}
|
|
265
|
-
],
|
|
266
|
-
url: '/v1/store',
|
|
267
|
-
...options
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
exports.Store = Store;
|
|
272
|
-
class Tags {
|
|
273
|
-
/**
|
|
274
|
-
* Get tags
|
|
275
|
-
* Retrieves the store's tags.
|
|
276
|
-
*/
|
|
277
|
-
static getStorefrontTags(options) {
|
|
278
|
-
return (options.client ?? client_gen_1.client).get({
|
|
279
|
-
responseType: 'json',
|
|
280
|
-
security: [
|
|
281
|
-
{
|
|
282
|
-
name: 'Authorization',
|
|
283
|
-
type: 'apiKey'
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
name: 'Authorization',
|
|
287
|
-
type: 'apiKey'
|
|
288
|
-
}
|
|
289
|
-
],
|
|
290
|
-
url: '/v1/store/tags',
|
|
291
|
-
...options
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
exports.Tags = Tags;
|
|
296
|
-
//# sourceMappingURL=sdk.gen.js.map
|