@wix/auto_sdk_ecom_orders-settings 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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.context.d.ts +12 -0
  11. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.context.js +17 -0
  12. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.context.js.map +1 -0
  13. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.http.d.ts +15 -0
  14. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.http.js +115 -0
  15. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.http.js.map +1 -0
  16. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.meta.d.ts +14 -0
  17. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.meta.js +66 -0
  18. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.public.d.ts +30 -0
  20. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.public.js +35 -0
  21. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.public.js.map +1 -0
  22. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.types.d.ts +178 -0
  23. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.types.js +20 -0
  24. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.types.js.map +1 -0
  25. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.universal.d.ts +300 -0
  26. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.universal.js +141 -0
  27. package/build/cjs/src/ecom-v1-orders-settings-orders-settings.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ecom-v1-orders-settings-orders-settings.context.d.ts +12 -0
  39. package/build/es/src/ecom-v1-orders-settings-orders-settings.context.js +12 -0
  40. package/build/es/src/ecom-v1-orders-settings-orders-settings.context.js.map +1 -0
  41. package/build/es/src/ecom-v1-orders-settings-orders-settings.http.d.ts +15 -0
  42. package/build/es/src/ecom-v1-orders-settings-orders-settings.http.js +110 -0
  43. package/build/es/src/ecom-v1-orders-settings-orders-settings.http.js.map +1 -0
  44. package/build/es/src/ecom-v1-orders-settings-orders-settings.meta.d.ts +14 -0
  45. package/build/es/src/ecom-v1-orders-settings-orders-settings.meta.js +38 -0
  46. package/build/es/src/ecom-v1-orders-settings-orders-settings.meta.js.map +1 -0
  47. package/build/es/src/ecom-v1-orders-settings-orders-settings.public.d.ts +30 -0
  48. package/build/es/src/ecom-v1-orders-settings-orders-settings.public.js +28 -0
  49. package/build/es/src/ecom-v1-orders-settings-orders-settings.public.js.map +1 -0
  50. package/build/es/src/ecom-v1-orders-settings-orders-settings.types.d.ts +178 -0
  51. package/build/es/src/ecom-v1-orders-settings-orders-settings.types.js +17 -0
  52. package/build/es/src/ecom-v1-orders-settings-orders-settings.types.js.map +1 -0
  53. package/build/es/src/ecom-v1-orders-settings-orders-settings.universal.d.ts +300 -0
  54. package/build/es/src/ecom-v1-orders-settings-orders-settings.universal.js +113 -0
  55. package/build/es/src/ecom-v1-orders-settings-orders-settings.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.context.d.ts +12 -0
  66. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.context.js +17 -0
  67. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.http.d.ts +15 -0
  69. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.http.js +115 -0
  70. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.meta.d.ts +14 -0
  72. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.meta.js +66 -0
  73. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.public.d.ts +30 -0
  75. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.public.js +35 -0
  76. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.types.d.ts +178 -0
  78. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.types.js +20 -0
  79. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.types.js.map +1 -0
  80. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.universal.d.ts +300 -0
  81. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.universal.js +141 -0
  82. package/build/internal/cjs/src/ecom-v1-orders-settings-orders-settings.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.context.d.ts +12 -0
  93. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.context.js +12 -0
  94. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.http.d.ts +15 -0
  96. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.http.js +110 -0
  97. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.meta.d.ts +14 -0
  99. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.meta.js +38 -0
  100. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.public.d.ts +30 -0
  102. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.public.js +28 -0
  103. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.types.d.ts +178 -0
  105. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.types.js +17 -0
  106. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.types.js.map +1 -0
  107. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.universal.d.ts +300 -0
  108. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.universal.js +113 -0
  109. package/build/internal/es/src/ecom-v1-orders-settings-orders-settings.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,14 @@
1
+ import * as ambassadorWixEcomV1OrdersSettingsTypes from './ecom-v1-orders-settings-orders-settings.types.js';
2
+ import * as ambassadorWixEcomV1OrdersSettingsUniversalTypes from './ecom-v1-orders-settings-orders-settings.universal.js';
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
+ getUrl: (context: any) => string;
5
+ httpMethod: K;
6
+ path: string;
7
+ pathParams: M;
8
+ __requestType: T;
9
+ __originalRequestType: S;
10
+ __responseType: Q;
11
+ __originalResponseType: R;
12
+ };
13
+ export declare function getOrdersSettings(): __PublicMethodMetaInfo<'GET', {}, ambassadorWixEcomV1OrdersSettingsUniversalTypes.GetOrdersSettingsRequest, ambassadorWixEcomV1OrdersSettingsTypes.GetOrdersSettingsRequest, ambassadorWixEcomV1OrdersSettingsUniversalTypes.GetOrdersSettingsResponse & ambassadorWixEcomV1OrdersSettingsUniversalTypes.GetOrdersSettingsResponseNonNullableFields, ambassadorWixEcomV1OrdersSettingsTypes.GetOrdersSettingsResponse & ambassadorWixEcomV1OrdersSettingsTypes.GetOrdersSettingsResponseNonNullableFields>;
14
+ export declare function updateOrdersSettings(): __PublicMethodMetaInfo<'PATCH', {}, ambassadorWixEcomV1OrdersSettingsUniversalTypes.UpdateOrdersSettingsRequest, ambassadorWixEcomV1OrdersSettingsTypes.UpdateOrdersSettingsRequest, ambassadorWixEcomV1OrdersSettingsUniversalTypes.UpdateOrdersSettingsResponse & ambassadorWixEcomV1OrdersSettingsUniversalTypes.UpdateOrdersSettingsResponseNonNullableFields, ambassadorWixEcomV1OrdersSettingsTypes.UpdateOrdersSettingsResponse & ambassadorWixEcomV1OrdersSettingsTypes.UpdateOrdersSettingsResponseNonNullableFields>;
@@ -0,0 +1,38 @@
1
+ import * as ambassadorWixEcomV1OrdersSettings from './ecom-v1-orders-settings-orders-settings.http.js';
2
+ export function getOrdersSettings() {
3
+ const payload = {};
4
+ const getRequestOptions = ambassadorWixEcomV1OrdersSettings.getOrdersSettings(payload);
5
+ const getUrl = (context) => {
6
+ const { url } = getRequestOptions(context);
7
+ return url;
8
+ };
9
+ return {
10
+ getUrl,
11
+ httpMethod: 'GET',
12
+ path: '/v1/orders-settings',
13
+ pathParams: {},
14
+ __requestType: null,
15
+ __originalRequestType: null,
16
+ __responseType: null,
17
+ __originalResponseType: null,
18
+ };
19
+ }
20
+ export function updateOrdersSettings() {
21
+ const payload = {};
22
+ const getRequestOptions = ambassadorWixEcomV1OrdersSettings.updateOrdersSettings(payload);
23
+ const getUrl = (context) => {
24
+ const { url } = getRequestOptions(context);
25
+ return url;
26
+ };
27
+ return {
28
+ getUrl,
29
+ httpMethod: 'PATCH',
30
+ path: '/v1/orders-settings',
31
+ pathParams: {},
32
+ __requestType: null,
33
+ __originalRequestType: null,
34
+ __responseType: null,
35
+ __originalResponseType: null,
36
+ };
37
+ }
38
+ //# sourceMappingURL=ecom-v1-orders-settings-orders-settings.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-orders-settings-orders-settings.meta.js","sourceRoot":"","sources":["../../../src/ecom-v1-orders-settings-orders-settings.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iCAAiC,MAAM,mDAAmD,CAAC;AAsBvG,MAAM,UAAU,iBAAiB;IAU/B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,iCAAiC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB;IAUlC,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,iCAAiC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAElE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { EventDefinition, HttpClient } from '@wix/sdk-types';
2
+ import { GetOrdersSettingsResponse, GetOrdersSettingsResponseNonNullableFields, OrdersSettings, OrdersSettingsUpdatedEnvelope, UpdateOrdersSettingsResponse, UpdateOrdersSettingsResponseNonNullableFields } from './ecom-v1-orders-settings-orders-settings.universal.js';
3
+ export declare const __metadata: {
4
+ PACKAGE_NAME: string;
5
+ };
6
+ export declare function getOrdersSettings(httpClient: HttpClient): GetOrdersSettingsSignature;
7
+ interface GetOrdersSettingsSignature {
8
+ /**
9
+ * Retrieves the sites' order settings.
10
+ *
11
+ *
12
+ * The `getOrdersSettings()` function returns a Promise that resolves to orders settings.
13
+ * @returns The requested orders settings.
14
+ */
15
+ (): Promise<GetOrdersSettingsResponse & GetOrdersSettingsResponseNonNullableFields>;
16
+ }
17
+ export declare function updateOrdersSettings(httpClient: HttpClient): UpdateOrdersSettingsSignature;
18
+ interface UpdateOrdersSettingsSignature {
19
+ /**
20
+ * Updates the sites' orders settings.
21
+ *
22
+ *
23
+ * The `updateOrdersSettings()` function returns a Promise that resolves to the newly updated orders settings.
24
+ * @param - Orders settings to update.
25
+ * @returns The updated orders settings.
26
+ */
27
+ (ordersSettings: OrdersSettings): Promise<UpdateOrdersSettingsResponse & UpdateOrdersSettingsResponseNonNullableFields>;
28
+ }
29
+ export declare const onOrdersSettingsUpdated: EventDefinition<OrdersSettingsUpdatedEnvelope, "wix.ecom.v1.orders_settings_updated">;
30
+ export { ActionEvent, BaseEventMetadata, DeleteOrdersSettingsRequest, DeleteOrdersSettingsResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetOrdersSettingsRequest, GetOrdersSettingsResponse, GetOrdersSettingsResponseNonNullableFields, IdentificationData, IdentificationDataIdOneOf, InventoryUpdateTrigger, ListOrdersSettingsRequest, ListOrdersSettingsResponse, MessageEnvelope, OrdersSettings, OrdersSettingsUpdatedEnvelope, RestoreInfo, UpdateOrdersSettingsRequest, UpdateOrdersSettingsResponse, UpdateOrdersSettingsResponseNonNullableFields, WebhookIdentityType, } from './ecom-v1-orders-settings-orders-settings.universal.js';
@@ -0,0 +1,28 @@
1
+ import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';
2
+ import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
3
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
4
+ import { EventDefinition } from '@wix/sdk-types';
5
+ import { getOrdersSettings as universalGetOrdersSettings, updateOrdersSettings as universalUpdateOrdersSettings, } from './ecom-v1-orders-settings-orders-settings.universal.js';
6
+ export const __metadata = { PACKAGE_NAME: '@wix/ecom' };
7
+ export function getOrdersSettings(httpClient) {
8
+ return () => universalGetOrdersSettings(
9
+ // @ts-ignore
10
+ { httpClient });
11
+ }
12
+ export function updateOrdersSettings(httpClient) {
13
+ return (ordersSettings) => universalUpdateOrdersSettings(ordersSettings,
14
+ // @ts-ignore
15
+ { httpClient });
16
+ }
17
+ export const onOrdersSettingsUpdated = EventDefinition('wix.ecom.v1.orders_settings_updated', true, (event) => renameKeysFromRESTResponseToSDKResponse(transformPaths(event, [
18
+ {
19
+ transformFn: transformRESTTimestampToSDKTimestamp,
20
+ paths: [
21
+ { path: 'entity.createdDate' },
22
+ { path: 'entity.updatedDate' },
23
+ { path: 'metadata.eventTime' },
24
+ ],
25
+ },
26
+ ])))();
27
+ export { InventoryUpdateTrigger, WebhookIdentityType, } from './ecom-v1-orders-settings-orders-settings.universal.js';
28
+ //# sourceMappingURL=ecom-v1-orders-settings-orders-settings.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-orders-settings-orders-settings.public.js","sourceRoot":"","sources":["../../../src/ecom-v1-orders-settings-orders-settings.public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,eAAe,EAAc,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAOL,iBAAiB,IAAI,0BAA0B,EAC/C,oBAAoB,IAAI,6BAA6B,GACtD,MAAM,wDAAwD,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAExD,MAAM,UAAU,iBAAiB,CAC/B,UAAsB;IAEtB,OAAO,GAAG,EAAE,CACV,0BAA0B;IACxB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAeD,MAAM,UAAU,oBAAoB,CAClC,UAAsB;IAEtB,OAAO,CAAC,cAA8B,EAAE,EAAE,CACxC,6BAA6B,CAC3B,cAAc;IACd,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAgBD,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CACpD,qCAAqC,EACrC,IAAI,EACJ,CAAC,KAAoC,EAAE,EAAE,CACvC,uCAAuC,CACrC,cAAc,CAAC,KAAK,EAAE;IACpB;QACE,WAAW,EAAE,oCAAoC;QACjD,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,oBAAoB,EAAE;YAC9B,EAAE,IAAI,EAAE,oBAAoB,EAAE;YAC9B,EAAE,IAAI,EAAE,oBAAoB,EAAE;SAC/B;KACF;CACF,CAAC,CACH,CACJ,EAAiC,CAAC;AAEnC,OAAO,EAgBL,sBAAsB,EAUtB,mBAAmB,GACpB,MAAM,wDAAwD,CAAC"}
@@ -0,0 +1,178 @@
1
+ export interface OrdersSettings {
2
+ /**
3
+ * Defines when to update the store inventory.
4
+ * Default: `ON_ORDER_PLACED`
5
+ */
6
+ inventoryUpdateTrigger?: InventoryUpdateTrigger;
7
+ /**
8
+ * Whether to automatically create invoices for every new order paid online.
9
+ * <br>
10
+ * Default: `false`
11
+ * <br>
12
+ * **Note**: The issued invoice for an order is not a tax invoice and doesn't reflect refunds. You are responsible for ensuring that invoices you issue conform to any relevant legal requirements.
13
+ */
14
+ createInvoice?: boolean | null;
15
+ /**
16
+ * Date and time the orders settings were created.
17
+ * @readonly
18
+ */
19
+ createdDate?: Date | null;
20
+ /**
21
+ * Date and time the orders settings were updated.
22
+ * @readonly
23
+ */
24
+ updatedDate?: Date | null;
25
+ }
26
+ export declare enum InventoryUpdateTrigger {
27
+ UNKNOWN_INVENTORY_UPDATE_TRIGGER = "UNKNOWN_INVENTORY_UPDATE_TRIGGER",
28
+ /** Stock quantities will update only after the payment is approved. */
29
+ ON_ORDER_PAID = "ON_ORDER_PAID",
30
+ /** Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock. */
31
+ ON_ORDER_PLACED = "ON_ORDER_PLACED"
32
+ }
33
+ export interface GetOrdersSettingsRequest {
34
+ }
35
+ export interface GetOrdersSettingsResponse {
36
+ /** Orders settings. */
37
+ ordersSettings?: OrdersSettings;
38
+ }
39
+ export interface UpdateOrdersSettingsRequest {
40
+ /** Orders settings to update. */
41
+ ordersSettings: OrdersSettings;
42
+ }
43
+ export interface UpdateOrdersSettingsResponse {
44
+ /** The updated orders settings. */
45
+ ordersSettings?: OrdersSettings;
46
+ }
47
+ export interface DeleteOrdersSettingsRequest {
48
+ }
49
+ export interface DeleteOrdersSettingsResponse {
50
+ }
51
+ export interface ListOrdersSettingsRequest {
52
+ }
53
+ export interface ListOrdersSettingsResponse {
54
+ /** List of retrieved orders settings. */
55
+ ordersSettings?: OrdersSettings[];
56
+ }
57
+ export interface DomainEvent extends DomainEventBodyOneOf {
58
+ createdEvent?: EntityCreatedEvent;
59
+ updatedEvent?: EntityUpdatedEvent;
60
+ deletedEvent?: EntityDeletedEvent;
61
+ actionEvent?: ActionEvent;
62
+ /**
63
+ * Unique event ID.
64
+ * Allows clients to ignore duplicate webhooks.
65
+ */
66
+ id?: string;
67
+ /**
68
+ * Assumes actions are also always typed to an entity_type
69
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
70
+ */
71
+ entityFqdn?: string;
72
+ /**
73
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
74
+ * This is although the created/updated/deleted notion is duplication of the oneof types
75
+ * Example: created/updated/deleted/started/completed/email_opened
76
+ */
77
+ slug?: string;
78
+ /** ID of the entity associated with the event. */
79
+ entityId?: string;
80
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
81
+ eventTime?: Date | null;
82
+ /**
83
+ * Whether the event was triggered as a result of a privacy regulation application
84
+ * (for example, GDPR).
85
+ */
86
+ triggeredByAnonymizeRequest?: boolean | null;
87
+ /** If present, indicates the action that triggered the event. */
88
+ originatedFrom?: string | null;
89
+ /**
90
+ * A sequence number defining the order of updates to the underlying entity.
91
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
92
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
93
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
94
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
95
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
96
+ */
97
+ entityEventSequence?: string | null;
98
+ }
99
+ /** @oneof */
100
+ export interface DomainEventBodyOneOf {
101
+ createdEvent?: EntityCreatedEvent;
102
+ updatedEvent?: EntityUpdatedEvent;
103
+ deletedEvent?: EntityDeletedEvent;
104
+ actionEvent?: ActionEvent;
105
+ }
106
+ export interface EntityCreatedEvent {
107
+ entityAsJson?: string;
108
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
109
+ restoreInfo?: RestoreInfo;
110
+ }
111
+ export interface RestoreInfo {
112
+ deletedDate?: Date | null;
113
+ }
114
+ export interface EntityUpdatedEvent {
115
+ /**
116
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
117
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
118
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
119
+ */
120
+ currentEntityAsJson?: string;
121
+ }
122
+ export interface EntityDeletedEvent {
123
+ /** Entity that was deleted */
124
+ deletedEntityAsJson?: string | null;
125
+ }
126
+ export interface ActionEvent {
127
+ bodyAsJson?: string;
128
+ }
129
+ export interface MessageEnvelope {
130
+ /** App instance ID. */
131
+ instanceId?: string | null;
132
+ /** Event type. */
133
+ eventType?: string;
134
+ /** The identification type and identity data. */
135
+ identity?: IdentificationData;
136
+ /** Stringify payload. */
137
+ data?: string;
138
+ }
139
+ export interface IdentificationData extends IdentificationDataIdOneOf {
140
+ /** ID of a site visitor that has not logged in to the site. */
141
+ anonymousVisitorId?: string;
142
+ /** ID of a site visitor that has logged in to the site. */
143
+ memberId?: string;
144
+ /** ID of a Wix user (site owner, contributor, etc.). */
145
+ wixUserId?: string;
146
+ /** ID of an app. */
147
+ appId?: string;
148
+ /** @readonly */
149
+ identityType?: WebhookIdentityType;
150
+ }
151
+ /** @oneof */
152
+ export interface IdentificationDataIdOneOf {
153
+ /** ID of a site visitor that has not logged in to the site. */
154
+ anonymousVisitorId?: string;
155
+ /** ID of a site visitor that has logged in to the site. */
156
+ memberId?: string;
157
+ /** ID of a Wix user (site owner, contributor, etc.). */
158
+ wixUserId?: string;
159
+ /** ID of an app. */
160
+ appId?: string;
161
+ }
162
+ export declare enum WebhookIdentityType {
163
+ UNKNOWN = "UNKNOWN",
164
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
165
+ MEMBER = "MEMBER",
166
+ WIX_USER = "WIX_USER",
167
+ APP = "APP"
168
+ }
169
+ interface OrdersSettingsNonNullableFields {
170
+ inventoryUpdateTrigger: InventoryUpdateTrigger;
171
+ }
172
+ export interface GetOrdersSettingsResponseNonNullableFields {
173
+ ordersSettings?: OrdersSettingsNonNullableFields;
174
+ }
175
+ export interface UpdateOrdersSettingsResponseNonNullableFields {
176
+ ordersSettings?: OrdersSettingsNonNullableFields;
177
+ }
178
+ export {};
@@ -0,0 +1,17 @@
1
+ export var InventoryUpdateTrigger;
2
+ (function (InventoryUpdateTrigger) {
3
+ InventoryUpdateTrigger["UNKNOWN_INVENTORY_UPDATE_TRIGGER"] = "UNKNOWN_INVENTORY_UPDATE_TRIGGER";
4
+ /** Stock quantities will update only after the payment is approved. */
5
+ InventoryUpdateTrigger["ON_ORDER_PAID"] = "ON_ORDER_PAID";
6
+ /** Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock. */
7
+ InventoryUpdateTrigger["ON_ORDER_PLACED"] = "ON_ORDER_PLACED";
8
+ })(InventoryUpdateTrigger || (InventoryUpdateTrigger = {}));
9
+ export var WebhookIdentityType;
10
+ (function (WebhookIdentityType) {
11
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
12
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
13
+ WebhookIdentityType["MEMBER"] = "MEMBER";
14
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
15
+ WebhookIdentityType["APP"] = "APP";
16
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
17
+ //# sourceMappingURL=ecom-v1-orders-settings-orders-settings.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-v1-orders-settings-orders-settings.types.js","sourceRoot":"","sources":["../../../src/ecom-v1-orders-settings-orders-settings.types.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,+FAAqE,CAAA;IACrE,uEAAuE;IACvE,yDAA+B,CAAA;IAC/B,gIAAgI;IAChI,6DAAmC,CAAA;AACrC,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AAiJD,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B"}
@@ -0,0 +1,300 @@
1
+ export interface OrdersSettings {
2
+ /**
3
+ * Defines when to update the store inventory.
4
+ *
5
+ * - `ON_ORDER_PAID`: Stock quantities will update only after the payment is approved.
6
+ * - `ON_ORDER_PLACED`: Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock.
7
+ *
8
+ * Default: `ON_ORDER_PLACED`
9
+ */
10
+ inventoryUpdateTrigger?: InventoryUpdateTrigger;
11
+ /**
12
+ * Whether to automatically create invoices for every new order paid online.
13
+ * Default: `false`
14
+ */
15
+ createInvoice?: boolean | null;
16
+ /**
17
+ * Date and time the orders settings were created.
18
+ * @readonly
19
+ */
20
+ _createdDate?: Date | null;
21
+ /**
22
+ * Date and time the orders settings were updated.
23
+ * @readonly
24
+ */
25
+ _updatedDate?: Date | null;
26
+ }
27
+ export declare enum InventoryUpdateTrigger {
28
+ UNKNOWN_INVENTORY_UPDATE_TRIGGER = "UNKNOWN_INVENTORY_UPDATE_TRIGGER",
29
+ /** Stock quantities will update only after the payment is approved. */
30
+ ON_ORDER_PAID = "ON_ORDER_PAID",
31
+ /** Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock. */
32
+ ON_ORDER_PLACED = "ON_ORDER_PLACED"
33
+ }
34
+ export interface GetOrdersSettingsRequest {
35
+ }
36
+ export interface GetOrdersSettingsResponse {
37
+ /** Orders settings. */
38
+ ordersSettings?: OrdersSettings;
39
+ }
40
+ export interface UpdateOrdersSettingsRequest {
41
+ /** Orders settings to update. */
42
+ ordersSettings: OrdersSettings;
43
+ }
44
+ export interface UpdateOrdersSettingsResponse {
45
+ /** The updated orders settings. */
46
+ ordersSettings?: OrdersSettings;
47
+ }
48
+ export interface DeleteOrdersSettingsRequest {
49
+ }
50
+ export interface DeleteOrdersSettingsResponse {
51
+ }
52
+ export interface ListOrdersSettingsRequest {
53
+ }
54
+ export interface ListOrdersSettingsResponse {
55
+ /** List of retrieved orders settings. */
56
+ ordersSettings?: OrdersSettings[];
57
+ }
58
+ export interface DomainEvent extends DomainEventBodyOneOf {
59
+ createdEvent?: EntityCreatedEvent;
60
+ updatedEvent?: EntityUpdatedEvent;
61
+ deletedEvent?: EntityDeletedEvent;
62
+ actionEvent?: ActionEvent;
63
+ /**
64
+ * Unique event ID.
65
+ * Allows clients to ignore duplicate webhooks.
66
+ */
67
+ _id?: string;
68
+ /**
69
+ * Assumes actions are also always typed to an entity_type
70
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
71
+ */
72
+ entityFqdn?: string;
73
+ /**
74
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
75
+ * This is although the created/updated/deleted notion is duplication of the oneof types
76
+ * Example: created/updated/deleted/started/completed/email_opened
77
+ */
78
+ slug?: string;
79
+ /** ID of the entity associated with the event. */
80
+ entityId?: string;
81
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
82
+ eventTime?: Date | null;
83
+ /**
84
+ * Whether the event was triggered as a result of a privacy regulation application
85
+ * (for example, GDPR).
86
+ */
87
+ triggeredByAnonymizeRequest?: boolean | null;
88
+ /** If present, indicates the action that triggered the event. */
89
+ originatedFrom?: string | null;
90
+ /**
91
+ * A sequence number defining the order of updates to the underlying entity.
92
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
93
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
94
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
95
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
96
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
97
+ */
98
+ entityEventSequence?: string | null;
99
+ }
100
+ /** @oneof */
101
+ export interface DomainEventBodyOneOf {
102
+ createdEvent?: EntityCreatedEvent;
103
+ updatedEvent?: EntityUpdatedEvent;
104
+ deletedEvent?: EntityDeletedEvent;
105
+ actionEvent?: ActionEvent;
106
+ }
107
+ export interface EntityCreatedEvent {
108
+ entity?: string;
109
+ }
110
+ export interface RestoreInfo {
111
+ deletedDate?: Date | null;
112
+ }
113
+ export interface EntityUpdatedEvent {
114
+ /**
115
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
116
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
117
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
118
+ */
119
+ currentEntity?: string;
120
+ }
121
+ export interface EntityDeletedEvent {
122
+ /** Entity that was deleted */
123
+ deletedEntity?: string | null;
124
+ }
125
+ export interface ActionEvent {
126
+ body?: string;
127
+ }
128
+ export interface MessageEnvelope {
129
+ /** App instance ID. */
130
+ instanceId?: string | null;
131
+ /** Event type. */
132
+ eventType?: string;
133
+ /** The identification type and identity data. */
134
+ identity?: IdentificationData;
135
+ /** Stringify payload. */
136
+ data?: string;
137
+ }
138
+ export interface IdentificationData extends IdentificationDataIdOneOf {
139
+ /** ID of a site visitor that has not logged in to the site. */
140
+ anonymousVisitorId?: string;
141
+ /** ID of a site visitor that has logged in to the site. */
142
+ memberId?: string;
143
+ /** ID of a Wix user (site owner, contributor, etc.). */
144
+ wixUserId?: string;
145
+ /** ID of an app. */
146
+ appId?: string;
147
+ /** @readonly */
148
+ identityType?: WebhookIdentityType;
149
+ }
150
+ /** @oneof */
151
+ export interface IdentificationDataIdOneOf {
152
+ /** ID of a site visitor that has not logged in to the site. */
153
+ anonymousVisitorId?: string;
154
+ /** ID of a site visitor that has logged in to the site. */
155
+ memberId?: string;
156
+ /** ID of a Wix user (site owner, contributor, etc.). */
157
+ wixUserId?: string;
158
+ /** ID of an app. */
159
+ appId?: string;
160
+ }
161
+ export declare enum WebhookIdentityType {
162
+ UNKNOWN = "UNKNOWN",
163
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
164
+ MEMBER = "MEMBER",
165
+ WIX_USER = "WIX_USER",
166
+ APP = "APP"
167
+ }
168
+ interface OrdersSettingsNonNullableFields {
169
+ inventoryUpdateTrigger: InventoryUpdateTrigger;
170
+ }
171
+ export interface GetOrdersSettingsResponseNonNullableFields {
172
+ ordersSettings?: OrdersSettingsNonNullableFields;
173
+ }
174
+ export interface UpdateOrdersSettingsResponseNonNullableFields {
175
+ ordersSettings?: OrdersSettingsNonNullableFields;
176
+ }
177
+ export interface BaseEventMetadata {
178
+ /** App instance ID. */
179
+ instanceId?: string | null;
180
+ /** Event type. */
181
+ eventType?: string;
182
+ /** The identification type and identity data. */
183
+ identity?: IdentificationData;
184
+ }
185
+ export interface EventMetadata extends BaseEventMetadata {
186
+ /**
187
+ * Unique event ID.
188
+ * Allows clients to ignore duplicate webhooks.
189
+ */
190
+ _id?: string;
191
+ /**
192
+ * Assumes actions are also always typed to an entity_type
193
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
194
+ */
195
+ entityFqdn?: string;
196
+ /**
197
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
198
+ * This is although the created/updated/deleted notion is duplication of the oneof types
199
+ * Example: created/updated/deleted/started/completed/email_opened
200
+ */
201
+ slug?: string;
202
+ /** ID of the entity associated with the event. */
203
+ entityId?: string;
204
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
205
+ eventTime?: Date | null;
206
+ /**
207
+ * Whether the event was triggered as a result of a privacy regulation application
208
+ * (for example, GDPR).
209
+ */
210
+ triggeredByAnonymizeRequest?: boolean | null;
211
+ /** If present, indicates the action that triggered the event. */
212
+ originatedFrom?: string | null;
213
+ /**
214
+ * A sequence number defining the order of updates to the underlying entity.
215
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
216
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
217
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
218
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
219
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
220
+ */
221
+ entityEventSequence?: string | null;
222
+ }
223
+ export interface OrdersSettingsUpdatedEnvelope {
224
+ entity: OrdersSettings;
225
+ metadata: EventMetadata;
226
+ }
227
+ /**
228
+ * Triggered when orders settings are updated.
229
+ * @permissionScope Manage Stores - all permissions
230
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
231
+ * @permissionScope Read eCommerce - all read permissions
232
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
233
+ * @permissionScope Read Orders
234
+ * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
235
+ * @permissionScope Read Stores - all read permissions
236
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
237
+ * @permissionScope Manage Restaurants - all permissions
238
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
239
+ * @permissionScope Manage eCommerce - all permissions
240
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
241
+ * @permissionScope Manage Orders
242
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
243
+ * @permissionId ECOM.READ_ORDERS_SETTINGS
244
+ * @webhook
245
+ * @eventType wix.ecom.v1.orders_settings_updated
246
+ * @documentationMaturity preview
247
+ */
248
+ export declare function onOrdersSettingsUpdated(handler: (event: OrdersSettingsUpdatedEnvelope) => void | Promise<void>): void;
249
+ /**
250
+ * Retrieves the sites' order settings.
251
+ *
252
+ *
253
+ * The `getOrdersSettings()` function returns a Promise that resolves to orders settings.
254
+ * @public
255
+ * @documentationMaturity preview
256
+ * @permissionId ECOM.READ_ORDERS_SETTINGS
257
+ * @permissionScope Manage Stores - all permissions
258
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
259
+ * @permissionScope Read eCommerce - all read permissions
260
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
261
+ * @permissionScope Read Orders
262
+ * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
263
+ * @permissionScope Read Stores - all read permissions
264
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
265
+ * @permissionScope Manage Restaurants - all permissions
266
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
267
+ * @permissionScope Manage eCommerce - all permissions
268
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
269
+ * @permissionScope Manage Orders
270
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
271
+ * @applicableIdentity APP
272
+ * @applicableIdentity VISITOR
273
+ * @returns The requested orders settings.
274
+ * @fqn wix.ecom.orders_settings.api.v1.OrdersSettingsService.GetOrdersSettings
275
+ */
276
+ export declare function getOrdersSettings(): Promise<GetOrdersSettingsResponse & GetOrdersSettingsResponseNonNullableFields>;
277
+ /**
278
+ * Updates the sites' orders settings.
279
+ *
280
+ *
281
+ * The `updateOrdersSettings()` function returns a Promise that resolves to the newly updated orders settings.
282
+ * @public
283
+ * @documentationMaturity preview
284
+ * @requiredField ordersSettings
285
+ * @param ordersSettings - Orders settings to update.
286
+ * @permissionId ECOM.UPDATE_ORDERS_SETTINGS
287
+ * @permissionScope Manage Stores - all permissions
288
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
289
+ * @permissionScope Manage Restaurants - all permissions
290
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
291
+ * @permissionScope Manage eCommerce - all permissions
292
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
293
+ * @permissionScope Manage Orders
294
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
295
+ * @applicableIdentity APP
296
+ * @returns The updated orders settings.
297
+ * @fqn wix.ecom.orders_settings.api.v1.OrdersSettingsService.UpdateOrdersSettings
298
+ */
299
+ export declare function updateOrdersSettings(ordersSettings: OrdersSettings): Promise<UpdateOrdersSettingsResponse & UpdateOrdersSettingsResponseNonNullableFields>;
300
+ export {};