@paynow-gg/typescript-sdk 1.0.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.
Files changed (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/dist/base-api.d.ts +58 -0
  4. package/dist/base-api.d.ts.map +1 -0
  5. package/dist/base-api.js +103 -0
  6. package/dist/base-api.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +8 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/management-client/client/client.d.ts +3 -0
  12. package/dist/management-client/client/client.d.ts.map +1 -0
  13. package/dist/management-client/client/client.js +100 -0
  14. package/dist/management-client/client/client.js.map +1 -0
  15. package/dist/management-client/client/index.d.ts +8 -0
  16. package/dist/management-client/client/index.d.ts.map +1 -0
  17. package/dist/management-client/client/index.js +14 -0
  18. package/dist/management-client/client/index.js.map +1 -0
  19. package/dist/management-client/client/types.d.ts +94 -0
  20. package/dist/management-client/client/types.d.ts.map +1 -0
  21. package/dist/management-client/client/types.js +3 -0
  22. package/dist/management-client/client/types.js.map +1 -0
  23. package/dist/management-client/client/utils.d.ts +21 -0
  24. package/dist/management-client/client/utils.d.ts.map +1 -0
  25. package/dist/management-client/client/utils.js +226 -0
  26. package/dist/management-client/client/utils.js.map +1 -0
  27. package/dist/management-client/client.gen.d.ts +13 -0
  28. package/dist/management-client/client.gen.d.ts.map +1 -0
  29. package/dist/management-client/client.gen.js +9 -0
  30. package/dist/management-client/client.gen.js.map +1 -0
  31. package/dist/management-client/core/auth.d.ts +19 -0
  32. package/dist/management-client/core/auth.d.ts.map +1 -0
  33. package/dist/management-client/core/auth.js +18 -0
  34. package/dist/management-client/core/auth.js.map +1 -0
  35. package/dist/management-client/core/bodySerializer.d.ts +18 -0
  36. package/dist/management-client/core/bodySerializer.d.ts.map +1 -0
  37. package/dist/management-client/core/bodySerializer.js +57 -0
  38. package/dist/management-client/core/bodySerializer.js.map +1 -0
  39. package/dist/management-client/core/params.d.ts +24 -0
  40. package/dist/management-client/core/params.d.ts.map +1 -0
  41. package/dist/management-client/core/params.js +92 -0
  42. package/dist/management-client/core/params.js.map +1 -0
  43. package/dist/management-client/core/pathSerializer.d.ts +34 -0
  44. package/dist/management-client/core/pathSerializer.d.ts.map +1 -0
  45. package/dist/management-client/core/pathSerializer.js +123 -0
  46. package/dist/management-client/core/pathSerializer.js.map +1 -0
  47. package/dist/management-client/core/types.d.ts +74 -0
  48. package/dist/management-client/core/types.d.ts.map +1 -0
  49. package/dist/management-client/core/types.js +3 -0
  50. package/dist/management-client/core/types.js.map +1 -0
  51. package/dist/management-client/index.d.ts +3 -0
  52. package/dist/management-client/index.d.ts.map +1 -0
  53. package/dist/management-client/index.js +20 -0
  54. package/dist/management-client/index.js.map +1 -0
  55. package/dist/management-client/sdk.gen.d.ts +482 -0
  56. package/dist/management-client/sdk.gen.d.ts.map +1 -0
  57. package/dist/management-client/sdk.gen.js +2169 -0
  58. package/dist/management-client/sdk.gen.js.map +1 -0
  59. package/dist/management-client/types.gen.d.ts +6681 -0
  60. package/dist/management-client/types.gen.d.ts.map +1 -0
  61. package/dist/management-client/types.gen.js +384 -0
  62. package/dist/management-client/types.gen.js.map +1 -0
  63. package/dist/management.d.ts +22 -0
  64. package/dist/management.d.ts.map +1 -0
  65. package/dist/management.js +62 -0
  66. package/dist/management.js.map +1 -0
  67. package/dist/storefront-client/client/client.d.ts +3 -0
  68. package/dist/storefront-client/client/client.d.ts.map +1 -0
  69. package/dist/storefront-client/client/client.js +100 -0
  70. package/dist/storefront-client/client/client.js.map +1 -0
  71. package/dist/storefront-client/client/index.d.ts +8 -0
  72. package/dist/storefront-client/client/index.d.ts.map +1 -0
  73. package/dist/storefront-client/client/index.js +14 -0
  74. package/dist/storefront-client/client/index.js.map +1 -0
  75. package/dist/storefront-client/client/types.d.ts +94 -0
  76. package/dist/storefront-client/client/types.d.ts.map +1 -0
  77. package/dist/storefront-client/client/types.js +3 -0
  78. package/dist/storefront-client/client/types.js.map +1 -0
  79. package/dist/storefront-client/client/utils.d.ts +21 -0
  80. package/dist/storefront-client/client/utils.d.ts.map +1 -0
  81. package/dist/storefront-client/client/utils.js +226 -0
  82. package/dist/storefront-client/client/utils.js.map +1 -0
  83. package/dist/storefront-client/client.gen.d.ts +13 -0
  84. package/dist/storefront-client/client.gen.d.ts.map +1 -0
  85. package/dist/storefront-client/client.gen.js +9 -0
  86. package/dist/storefront-client/client.gen.js.map +1 -0
  87. package/dist/storefront-client/core/auth.d.ts +19 -0
  88. package/dist/storefront-client/core/auth.d.ts.map +1 -0
  89. package/dist/storefront-client/core/auth.js +18 -0
  90. package/dist/storefront-client/core/auth.js.map +1 -0
  91. package/dist/storefront-client/core/bodySerializer.d.ts +18 -0
  92. package/dist/storefront-client/core/bodySerializer.d.ts.map +1 -0
  93. package/dist/storefront-client/core/bodySerializer.js +57 -0
  94. package/dist/storefront-client/core/bodySerializer.js.map +1 -0
  95. package/dist/storefront-client/core/params.d.ts +24 -0
  96. package/dist/storefront-client/core/params.d.ts.map +1 -0
  97. package/dist/storefront-client/core/params.js +92 -0
  98. package/dist/storefront-client/core/params.js.map +1 -0
  99. package/dist/storefront-client/core/pathSerializer.d.ts +34 -0
  100. package/dist/storefront-client/core/pathSerializer.d.ts.map +1 -0
  101. package/dist/storefront-client/core/pathSerializer.js +123 -0
  102. package/dist/storefront-client/core/pathSerializer.js.map +1 -0
  103. package/dist/storefront-client/core/types.d.ts +74 -0
  104. package/dist/storefront-client/core/types.d.ts.map +1 -0
  105. package/dist/storefront-client/core/types.js +3 -0
  106. package/dist/storefront-client/core/types.js.map +1 -0
  107. package/dist/storefront-client/index.d.ts +3 -0
  108. package/dist/storefront-client/index.d.ts.map +1 -0
  109. package/dist/storefront-client/index.js +20 -0
  110. package/dist/storefront-client/index.js.map +1 -0
  111. package/dist/storefront-client/sdk.gen.d.ts +100 -0
  112. package/dist/storefront-client/sdk.gen.d.ts.map +1 -0
  113. package/dist/storefront-client/sdk.gen.js +296 -0
  114. package/dist/storefront-client/sdk.gen.js.map +1 -0
  115. package/dist/storefront-client/types.gen.d.ts +1410 -0
  116. package/dist/storefront-client/types.gen.d.ts.map +1 -0
  117. package/dist/storefront-client/types.gen.js +58 -0
  118. package/dist/storefront-client/types.gen.js.map +1 -0
  119. package/dist/storefront.d.ts +21 -0
  120. package/dist/storefront.d.ts.map +1 -0
  121. package/dist/storefront.js +63 -0
  122. package/dist/storefront.js.map +1 -0
  123. package/dist/types.d.ts +49 -0
  124. package/dist/types.d.ts.map +1 -0
  125. package/dist/types.js +9 -0
  126. package/dist/types.js.map +1 -0
  127. package/package.json +27 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildClientParams = void 0;
4
+ const extraPrefixesMap = {
5
+ $body_: 'body',
6
+ $headers_: 'headers',
7
+ $path_: 'path',
8
+ $query_: 'query',
9
+ };
10
+ const extraPrefixes = Object.entries(extraPrefixesMap);
11
+ const buildKeyMap = (fields, map) => {
12
+ if (!map) {
13
+ map = new Map();
14
+ }
15
+ for (const config of fields) {
16
+ if ('in' in config) {
17
+ if (config.key) {
18
+ map.set(config.key, {
19
+ in: config.in,
20
+ map: config.map,
21
+ });
22
+ }
23
+ }
24
+ else if (config.args) {
25
+ buildKeyMap(config.args, map);
26
+ }
27
+ }
28
+ return map;
29
+ };
30
+ const stripEmptySlots = (params) => {
31
+ for (const [slot, value] of Object.entries(params)) {
32
+ if (value && typeof value === 'object' && !Object.keys(value).length) {
33
+ delete params[slot];
34
+ }
35
+ }
36
+ };
37
+ const buildClientParams = (args, fields) => {
38
+ const params = {
39
+ body: {},
40
+ headers: {},
41
+ path: {},
42
+ query: {},
43
+ };
44
+ const map = buildKeyMap(fields);
45
+ let config;
46
+ for (const [index, arg] of args.entries()) {
47
+ if (fields[index]) {
48
+ config = fields[index];
49
+ }
50
+ if (!config) {
51
+ continue;
52
+ }
53
+ if ('in' in config) {
54
+ if (config.key) {
55
+ const field = map.get(config.key);
56
+ const name = field.map || config.key;
57
+ params[field.in][name] = arg;
58
+ }
59
+ else {
60
+ params.body = arg;
61
+ }
62
+ }
63
+ else {
64
+ for (const [key, value] of Object.entries(arg ?? {})) {
65
+ const field = map.get(key);
66
+ if (field) {
67
+ const name = field.map || key;
68
+ params[field.in][name] = value;
69
+ }
70
+ else {
71
+ const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
72
+ if (extra) {
73
+ const [prefix, slot] = extra;
74
+ params[slot][key.slice(prefix.length)] = value;
75
+ }
76
+ else {
77
+ for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) {
78
+ if (allowed) {
79
+ params[slot][key] = value;
80
+ break;
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ stripEmptySlots(params);
89
+ return params;
90
+ };
91
+ exports.buildClientParams = buildClientParams;
92
+ //# sourceMappingURL=params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/storefront-client/core/params.ts"],"names":[],"mappings":";;;AAqBA,MAAM,gBAAgB,GAAyB;IAC7C,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,OAAO;CACjB,CAAC;AACF,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAUvD,MAAM,WAAW,GAAG,CAAC,MAAoB,EAAE,GAAY,EAAU,EAAE;IACjE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;YACnB,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;gBACf,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,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EAAE,CAAC;4BACF,IAAI,OAAO,EAAE,CAAC;gCACX,MAAM,CAAC,IAAY,CAA6B,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gCAC/D,MAAM;4BACR,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAnEW,QAAA,iBAAiB,qBAmE5B"}
@@ -0,0 +1,34 @@
1
+ interface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {
2
+ }
3
+ interface SerializePrimitiveOptions {
4
+ allowReserved?: boolean;
5
+ name: string;
6
+ }
7
+ export interface SerializerOptions<T> {
8
+ /**
9
+ * @default true
10
+ */
11
+ explode: boolean;
12
+ style: T;
13
+ }
14
+ export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
15
+ export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
16
+ type MatrixStyle = 'label' | 'matrix' | 'simple';
17
+ export type ObjectStyle = 'form' | 'deepObject';
18
+ type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
19
+ interface SerializePrimitiveParam extends SerializePrimitiveOptions {
20
+ value: string;
21
+ }
22
+ export declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "." | ";" | "," | "&";
23
+ export declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => "," | "|" | "%20";
24
+ export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "." | ";" | "," | "&";
25
+ export declare const serializeArrayParam: ({ allowReserved, explode, name, style, value, }: SerializeOptions<ArraySeparatorStyle> & {
26
+ value: unknown[];
27
+ }) => string;
28
+ export declare const serializePrimitiveParam: ({ allowReserved, name, value, }: SerializePrimitiveParam) => string;
29
+ export declare const serializeObjectParam: ({ allowReserved, explode, name, style, value, valueOnly, }: SerializeOptions<ObjectSeparatorStyle> & {
30
+ value: Record<string, unknown> | Date;
31
+ valueOnly?: boolean;
32
+ }) => string;
33
+ export {};
34
+ //# sourceMappingURL=pathSerializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathSerializer.d.ts","sourceRoot":"","sources":["../../../src/storefront-client/core/pathSerializer.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB,CAAC,CAAC,CAC1B,SAAQ,yBAAyB,EAC/B,iBAAiB,CAAC,CAAC,CAAC;CAAG;AAE3B,UAAU,yBAAyB;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,CAAC,CAAC;CACV;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,WAAW,CAAC;AAC3D,KAAK,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC;AAChD,KAAK,oBAAoB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEtD,UAAU,uBAAwB,SAAQ,yBAAyB;IACjE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,mBAAmB,0BAW/D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,mBAAmB,sBAWjE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,oBAAoB,0BAWjE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,iDAMjC,gBAAgB,CAAC,mBAAmB,CAAC,GAAG;IACzC,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB,WAkCA,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,iCAIrC,uBAAuB,WAYzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,4DAOlC,gBAAgB,CAAC,oBAAoB,CAAC,GAAG;IAC1C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,WAwCA,CAAC"}
@@ -0,0 +1,123 @@
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
@@ -0,0 +1 @@
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,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,KAAK,QAAQ;gBACX,OAAO,IAAI,IAAI,IAAI,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"}
@@ -0,0 +1,74 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/storefront-client/core/types.ts"],"names":[],"mappings":"AAAA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,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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/storefront-client/core/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './types.gen';
2
+ export * from './sdk.gen';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storefront-client/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,20 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storefront-client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,8CAA4B;AAC5B,4CAA0B"}
@@ -0,0 +1,100 @@
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
@@ -0,0 +1 @@
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,EAAE,MAAM,aAAa,CAAC;AAGr2D,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,UA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