@juo/blocks 2.0.0-alpha.4 → 2.0.0-alpha.6
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/dist/{ExtensionRoot-DRpD5EcC.js → ExtensionRoot-CG9dH98z.js} +1 -1
- package/dist/core.js +428 -11
- package/dist/{css-runtime-B7tZrBIp.js → css-runtime-CjZl0K48.js} +23 -17
- package/dist/editor/handler.d.ts.map +1 -1
- package/dist/editor.js +4 -1
- package/dist/{gridstack-adapter-BGKGC-eO.js → gridstack-adapter-C1Q8gbsH.js} +2 -2
- package/dist/languages.d.ts +51 -0
- package/dist/languages.d.ts.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/{project-gridstack-PxN_DIfP.js → project-gridstack-CRZ_7HoT.js} +1 -1
- package/dist/services/customer/adapter.d.ts +12 -0
- package/dist/services/customer/adapter.d.ts.map +1 -1
- package/dist/services/customer/adapter.test.d.ts +2 -0
- package/dist/services/customer/adapter.test.d.ts.map +1 -0
- package/dist/services/customer/customerService.d.ts.map +1 -1
- package/dist/services/customer/index.d.ts +1 -1
- package/dist/services/customer/index.d.ts.map +1 -1
- package/dist/services/customer/types.d.ts +13 -0
- package/dist/services/customer/types.d.ts.map +1 -1
- package/dist/services/login/adapter.d.ts.map +1 -1
- package/dist/services/login/loginService.d.ts +1 -0
- package/dist/services/login/loginService.d.ts.map +1 -1
- package/dist/services/login/loginService.test.d.ts +2 -0
- package/dist/services/login/loginService.test.d.ts.map +1 -0
- package/dist/services/subscription/adapter.d.ts +56 -1
- package/dist/services/subscription/adapter.d.ts.map +1 -1
- package/dist/services/subscription/index.d.ts +3 -1
- package/dist/services/subscription/index.d.ts.map +1 -1
- package/dist/services/subscription/instantOrderErrors.d.ts +66 -0
- package/dist/services/subscription/instantOrderErrors.d.ts.map +1 -0
- package/dist/services/subscription/lineRemoval.d.ts +56 -0
- package/dist/services/subscription/lineRemoval.d.ts.map +1 -0
- package/dist/services/subscription/lineRemoval.test.d.ts +2 -0
- package/dist/services/subscription/lineRemoval.test.d.ts.map +1 -0
- package/dist/services/subscription/paymentInstrument.d.ts +8 -1
- package/dist/services/subscription/paymentInstrument.d.ts.map +1 -1
- package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
- package/dist/services/subscription/types.d.ts +205 -1
- package/dist/services/subscription/types.d.ts.map +1 -1
- package/dist/theme-state.d.ts +10 -1
- package/dist/theme-state.d.ts.map +1 -1
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/vue/context.d.ts +25 -1
- package/dist/vue/context.d.ts.map +1 -1
- package/dist/vue/useTranslatedProp.test.d.ts +2 -0
- package/dist/vue/useTranslatedProp.test.d.ts.map +1 -0
- package/dist/vue.js +36 -2
- package/dist/web-components/editor/InlineText.d.ts +1 -0
- package/dist/web-components/editor/InlineText.d.ts.map +1 -1
- package/dist/web-components-editor.js +13 -5
- package/dist/web-components-runtime.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const SUPPORTED_UI_LANGUAGES: readonly [{
|
|
2
|
+
readonly code: "cs";
|
|
3
|
+
readonly label: "Czech";
|
|
4
|
+
}, {
|
|
5
|
+
readonly code: "da";
|
|
6
|
+
readonly label: "Danish";
|
|
7
|
+
}, {
|
|
8
|
+
readonly code: "nl";
|
|
9
|
+
readonly label: "Dutch";
|
|
10
|
+
}, {
|
|
11
|
+
readonly code: "en";
|
|
12
|
+
readonly label: "English";
|
|
13
|
+
}, {
|
|
14
|
+
readonly code: "fr";
|
|
15
|
+
readonly label: "French";
|
|
16
|
+
}, {
|
|
17
|
+
readonly code: "de";
|
|
18
|
+
readonly label: "German";
|
|
19
|
+
}, {
|
|
20
|
+
readonly code: "el";
|
|
21
|
+
readonly label: "Greek";
|
|
22
|
+
}, {
|
|
23
|
+
readonly code: "hu";
|
|
24
|
+
readonly label: "Hungarian";
|
|
25
|
+
}, {
|
|
26
|
+
readonly code: "pl";
|
|
27
|
+
readonly label: "Polish";
|
|
28
|
+
}, {
|
|
29
|
+
readonly code: "pt";
|
|
30
|
+
readonly label: "Portuguese";
|
|
31
|
+
}, {
|
|
32
|
+
readonly code: "sk";
|
|
33
|
+
readonly label: "Slovak";
|
|
34
|
+
}, {
|
|
35
|
+
readonly code: "sl";
|
|
36
|
+
readonly label: "Slovenian";
|
|
37
|
+
}, {
|
|
38
|
+
readonly code: "es";
|
|
39
|
+
readonly label: "Spanish";
|
|
40
|
+
}];
|
|
41
|
+
export type SupportedLanguageCode = (typeof SUPPORTED_UI_LANGUAGES)[number]["code"];
|
|
42
|
+
export type LanguageSelectOption = {
|
|
43
|
+
label: string;
|
|
44
|
+
value: SupportedLanguageCode;
|
|
45
|
+
};
|
|
46
|
+
export declare function toLanguageSelectOptions(languages: readonly {
|
|
47
|
+
code: SupportedLanguageCode;
|
|
48
|
+
label: string;
|
|
49
|
+
}[]): LanguageSelectOption[];
|
|
50
|
+
export declare const SUPPORTED_UI_LANGUAGE_OPTIONS: LanguageSelectOption[];
|
|
51
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAczB,CAAC;AAOX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;CAC9B,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GACnE,oBAAoB,EAAE,CAExB;AAED,eAAO,MAAM,6BAA6B,wBAEzC,CAAC"}
|
package/dist/main.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type { Block, BlockInstance, BlockDefinition, BlockLocaleFile, BlockRende
|
|
|
2
2
|
export { attachEmptyTracking, backfillInstanceDefaults, createBlockInstance, createBlockInstanceFromJSON, createBlockInstanceFromObject, createCeRenderer, defineBlock, defineBlockRuntime, getDefinedBlocks, hasRenderedContent, isStubDefinition, withWrapper, registerBlock, SelectedBlockContext, createSelectedBlock, BlockWrapperEvent, serializeBlocks, onRegisterBlock, getDevtoolsBlockState, setDevtoolsBlockProp, __recordDevtoolsInstance, __recordDevtoolsPropSetter, } from './block';
|
|
3
3
|
export { ThemeStateContext, createThemeState, indexOverrides, type TranslationCatalogs, type TranslationMode, type TranslationScope, type TranslationOverride, type ThemeLocaleState, type ThemeState, type ThemeSurface, type ThemeSurfaceState, type GlobalStyles, type GlobalStyleColors, type ThemeType, type LayoutEngine, DEFAULT_GLOBAL_STYLES, } from './theme-state';
|
|
4
4
|
export { TranslationContext, createTranslationService, type TranslationServiceOptions, type TranslationService, } from './translation';
|
|
5
|
+
export { SUPPORTED_UI_LANGUAGES, SUPPORTED_UI_LANGUAGE_OPTIONS, toLanguageSelectOptions, type LanguageSelectOption, type SupportedLanguageCode, } from './languages';
|
|
5
6
|
export { ContextRequestEvent, ContextProvideEvent, type ContextCallback, createContext, injectContext, provideContext, subscribeContext, type ContextType, type UnknownContext, } from './context';
|
|
6
7
|
export { StateContext, createState } from './state';
|
|
7
8
|
export { defineOverlayWrapper, type OverlayLayout } from './overlay-wrapper';
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,SAAS,C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EAAE,MAAM,YAAY,CAAC;AAEpE,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AAEzB,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,sCAAsC,CAAC;AAO9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,0B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iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,sCAAsC,CAAC;AAO9C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,sBAAsB,CAAC"}
|
|
@@ -3,7 +3,19 @@ import { ApiFetcher, Result } from '../../utils';
|
|
|
3
3
|
export interface CustomerAdapter {
|
|
4
4
|
getCurrent(): Promise<Result<Customer | null>>;
|
|
5
5
|
createPaymentMethod(params: CreatePaymentMethodParams): Promise<Result<CreatePaymentMethodOutcome>>;
|
|
6
|
+
updateAttributes(attributes: Record<string, string>): Promise<Result<Customer>>;
|
|
6
7
|
}
|
|
7
8
|
export declare function createMockCustomerAdapter(): CustomerAdapter;
|
|
9
|
+
export type V1CustomerBody = {
|
|
10
|
+
id: string;
|
|
11
|
+
displayName: string;
|
|
12
|
+
email?: string | null;
|
|
13
|
+
customAttributes: {
|
|
14
|
+
key: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
/** Maps a `GET/PATCH /customer/v1/customer` response body to the blocks `Customer`. */
|
|
19
|
+
export declare function fromV1Customer(body: V1CustomerBody): Customer;
|
|
8
20
|
export declare function createApiCustomerAdapter(fetcher: ApiFetcher): CustomerAdapter;
|
|
9
21
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,WAAW,eAAe;IAC9B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/C,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,WAAW,eAAe;IAC9B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/C,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACpG,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;CACjF;AAED,wBAAgB,yBAAyB,IAAI,eAAe,CAkC3D;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,gBAAgB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpD,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,QAAQ,CAS7D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,CAkE7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.test.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,eAAe,
|
|
1
|
+
{"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,eAAe,CA0BjB;AAED,eAAO,MAAM,sBAAsB;;CACkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type CustomerService, type Customer, type CreatePaymentMethodParams, type CreatePaymentMethodOutcome } from './types';
|
|
2
2
|
export { createCustomerService, CustomerServiceContext, } from './customerService';
|
|
3
|
-
export { type CustomerAdapter, createMockCustomerAdapter, createApiCustomerAdapter, } from './adapter';
|
|
3
|
+
export { type CustomerAdapter, type V1CustomerBody, createMockCustomerAdapter, createApiCustomerAdapter, fromV1Customer, } from './adapter';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,yBAAyB,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC/H,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,yBAAyB,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC/H,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,GACf,MAAM,WAAW,CAAC"}
|
|
@@ -7,6 +7,8 @@ export type Customer = {
|
|
|
7
7
|
name: string;
|
|
8
8
|
email?: string;
|
|
9
9
|
metadata?: Record<string, unknown>;
|
|
10
|
+
/** Customer-visible custom attributes (e.g. `date_of_birth`), keyed by attribute key. */
|
|
11
|
+
attributes?: Record<string, string>;
|
|
10
12
|
};
|
|
11
13
|
export type CreatePaymentMethodParams = {
|
|
12
14
|
provider: "shopify";
|
|
@@ -26,6 +28,17 @@ export type CustomerService = {
|
|
|
26
28
|
current: Signal<Customer | null>;
|
|
27
29
|
getCurrent(): Promise<Result<Customer | null>>;
|
|
28
30
|
createPaymentMethod(params: CreatePaymentMethodParams): Promise<Result<CreatePaymentMethodOutcome>>;
|
|
31
|
+
/**
|
|
32
|
+
* Sets the given customer-visible custom attributes, merged with the attributes already known
|
|
33
|
+
* on `current` — other blocks' attributes are preserved, so no block needs to know about every
|
|
34
|
+
* other attribute key in use. Internal (`_`-prefixed) and reserved keys are preserved
|
|
35
|
+
* server-side and rejected with a Failure when written. Updates `current` with the returned
|
|
36
|
+
* customer on success.
|
|
37
|
+
*
|
|
38
|
+
* Note: the underlying adapter/API call REPLACES the entire visible attribute set (there is no
|
|
39
|
+
* per-key clear); this merge happens in `createCustomerService`, not in the adapter.
|
|
40
|
+
*/
|
|
41
|
+
updateAttributes(attributes: Record<string, string>): Promise<Result<Customer>>;
|
|
29
42
|
accountOrdersUrl: Signal<string>;
|
|
30
43
|
};
|
|
31
44
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAEvF,oFAAoF;AACpF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../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AA;CAAE,GAC3C,YAAY,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/login/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1B,YAAY,CACV,MAAM,EACF;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC/B;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAChB;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAE/B,eAAe,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,UAAU,GAAG,eAAe,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,MAAM,CAAC;CACZ;AAED,wBAAgB,sBAAsB,CACpC,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7B,YAAY,CAwBd;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C,YAAY,CAoId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loginService.d.ts","sourceRoot":"","sources":["../../../src/services/login/loginService.ts"],"names":[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EAAE,MAAM,CAAC;KACjB,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;;;;;;;;;;;;;;;;EAmBA;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,wBAAwB;;;;;;;;;;;;;;;;EA+MhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginService.test.d.ts","sourceRoot":"","sources":["../../../src/services/login/loginService.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ApiFetcher, PaginatedList, Result } from '../../utils';
|
|
2
|
-
import { Subscription, SellingPlan, SellingPlanInterval, SearchOptions, PostableSubscriptionItem, UpdateSubscriptionItem, UpdateBoxItem, LastOrder, RenewNowResult, UpsellProduct } from './types';
|
|
2
|
+
import { Subscription, SellingPlan, SellingPlanInterval, SearchOptions, PostableSubscriptionItem, UpdateSubscriptionItem, UpdateBoxItem, LastOrder, RenewNowResult, UpsellProduct, UpdateDeliveryAddress, UpdateDeliveryAddressError, UpdateDeliveryMethodError, ShippingMethodOption, InstantOrderProducts, InstantOrderProductsQuery, InstantOrderPlacement } from './types';
|
|
3
3
|
import { ApplyDiscountError, DiscountRejectionReason, RemoveDiscountError } from './discountErrors';
|
|
4
|
+
import { InstantOrderProductsError, PlaceInstantOrderError } from './instantOrderErrors';
|
|
4
5
|
import { ProductAdapter } from '../product/adapter';
|
|
5
6
|
/**
|
|
6
7
|
* Adapter interface for subscription.
|
|
@@ -76,6 +77,45 @@ export interface SubscriptionAdapter {
|
|
|
76
77
|
subscriptionId: string;
|
|
77
78
|
customAttributes: Record<string, string>;
|
|
78
79
|
}): Promise<Result<Subscription>>;
|
|
80
|
+
/**
|
|
81
|
+
* Replace the subscription's delivery address (full replacement).
|
|
82
|
+
*
|
|
83
|
+
* The real adapter uses the legacy PUT
|
|
84
|
+
* /customer/subscriptions/{id}/shipping-address rather than PATCH
|
|
85
|
+
* /customer/v1/subscriptions/{id} with `deliveryAddress`. Only the legacy
|
|
86
|
+
* route preserves the delivery-method type — the v1 handler hardcodes
|
|
87
|
+
* `shipping`, so it converts a local-delivery contract and puts an address on
|
|
88
|
+
* a pickup one — and only it resolves `province` to a province code, honours
|
|
89
|
+
* the merchant's address-editing setting, and turns Shopify's address
|
|
90
|
+
* validation errors into a readable 400.
|
|
91
|
+
*/
|
|
92
|
+
updateDeliveryAddress(params: {
|
|
93
|
+
subscriptionId: string;
|
|
94
|
+
address: UpdateDeliveryAddress;
|
|
95
|
+
}): Promise<Result<void, UpdateDeliveryAddressError>>;
|
|
96
|
+
/**
|
|
97
|
+
* Shipping methods the subscription can move to. The one it is currently on
|
|
98
|
+
* is included and flagged `isActive` — every entry is selectable, so this is
|
|
99
|
+
* not a filter.
|
|
100
|
+
*/
|
|
101
|
+
getAvailableShippingMethods(params: {
|
|
102
|
+
subscriptionId: string;
|
|
103
|
+
}): Promise<Result<ShippingMethodOption[]>>;
|
|
104
|
+
/**
|
|
105
|
+
* Switch the subscription to another shipping method.
|
|
106
|
+
*
|
|
107
|
+
* Pickup points are out of scope: no parcel-locker payload is sent, which the
|
|
108
|
+
* endpoint reads as "preserve the existing pickup-point attributes".
|
|
109
|
+
*
|
|
110
|
+
* The handle must be one the subscription currently offers — the endpoint
|
|
111
|
+
* re-derives the list server-side and a stale handle fails the assertion as a
|
|
112
|
+
* 500, not a 4xx, so it surfaces as `UNKNOWN`. Re-read
|
|
113
|
+
* `getAvailableShippingMethods` before retrying.
|
|
114
|
+
*/
|
|
115
|
+
updateDeliveryMethod(params: {
|
|
116
|
+
subscriptionId: string;
|
|
117
|
+
shippingMethodHandle: string;
|
|
118
|
+
}): Promise<Result<void, UpdateDeliveryMethodError>>;
|
|
79
119
|
resume(params: {
|
|
80
120
|
subscriptionId: string;
|
|
81
121
|
}): Promise<Result<Subscription>>;
|
|
@@ -111,6 +151,14 @@ export interface SubscriptionAdapter {
|
|
|
111
151
|
quantity: number;
|
|
112
152
|
oneTime?: boolean;
|
|
113
153
|
}): Promise<Result>;
|
|
154
|
+
getInstantOrderProducts?(params: {
|
|
155
|
+
subscriptionId: string;
|
|
156
|
+
} & InstantOrderProductsQuery): Promise<Result<InstantOrderProducts, InstantOrderProductsError>>;
|
|
157
|
+
placeInstantOrder?(params: {
|
|
158
|
+
subscriptionId: string;
|
|
159
|
+
requestKey: string;
|
|
160
|
+
items: PostableSubscriptionItem[];
|
|
161
|
+
}): Promise<Result<InstantOrderPlacement, PlaceInstantOrderError>>;
|
|
114
162
|
}
|
|
115
163
|
export interface MockSubscriptionAdapterOptions {
|
|
116
164
|
addDiscountBehavior?: {
|
|
@@ -137,6 +185,13 @@ export interface MockSubscriptionAdapterOptions {
|
|
|
137
185
|
*/
|
|
138
186
|
productAdapter?: Pick<ProductAdapter, "getByVariantId" | "getById">;
|
|
139
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Recognises the optimistic-concurrency rejection the legacy customer
|
|
190
|
+
* subscription routes raise from a scope-wide `preValidation` hook when the
|
|
191
|
+
* caller sends a stale `X-Last-Updated-At`. It answers 400, the same status as
|
|
192
|
+
* a rejected address, so the message is the only discriminator.
|
|
193
|
+
*/
|
|
194
|
+
export declare function isStaleSubscriptionMessage(message: string | undefined): boolean;
|
|
140
195
|
export declare function createMockSubscriptionAdapter(options?: MockSubscriptionAdapterOptions): SubscriptionAdapter;
|
|
141
196
|
export declare function createApiSubscriptionAdapter(fetcher: ApiFetcher): SubscriptionAdapter;
|
|
142
197
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,EAIZ,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,EAIZ,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EAEb,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EACV,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAE9E;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAE5C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;IAE1D,YAAY,CAAC,MAAM,EAAE;QACnB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC;IAEtC,OAAO,CAAC,MAAM,EAAE;QACd,cAAc,E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UAAU,GAClB,mBAAmB,CA6pBrB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export type { SubscriptionAdapter, MockSubscriptionAdapterOptions } from './adapter';
|
|
2
|
-
export { createMockSubscriptionAdapter, createApiSubscriptionAdapter } from './adapter';
|
|
2
|
+
export { createMockSubscriptionAdapter, createApiSubscriptionAdapter, isStaleSubscriptionMessage, } from './adapter';
|
|
3
3
|
export { createSubscriptionService, SubscriptionServiceContext } from './subscriptionService';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export * from './discountErrors';
|
|
6
6
|
export * from './paymentInstrument';
|
|
7
|
+
export * from './lineRemoval';
|
|
8
|
+
export * from './instantOrderErrors';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed failures for the instant-order calls, in the same shape as
|
|
3
|
+
* {@link ./discountErrors.ts}: a `kind`-discriminated union, with `NETWORK` and
|
|
4
|
+
* `UNKNOWN` as the catch-alls carrying an optional human `message`.
|
|
5
|
+
*
|
|
6
|
+
* The granularity here is exactly what the wire can support. The endpoint
|
|
7
|
+
* refuses with a plain HTTP status and a human `message` — it does not send a
|
|
8
|
+
* machine-readable code — so hosts discriminate on status. The backend's own
|
|
9
|
+
* refusal codes collapse accordingly: `invalid_items` and
|
|
10
|
+
* `shipping_method_unavailable` both arrive as 400, and `disabled`,
|
|
11
|
+
* `product_not_allowed` and `subscription_ineligible` all arrive as 403. Telling
|
|
12
|
+
* those apart would need the backend to send a code first, the way discounts send
|
|
13
|
+
* `DISCOUNT_CODE_REJECTED`.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Reading the instant-order catalog. An adapter that does not implement instant
|
|
17
|
+
* orders is deliberately **not** an error: it resolves to an unavailable,
|
|
18
|
+
* empty catalog, which is precisely the signal a consumer needs to hide the
|
|
19
|
+
* entry point.
|
|
20
|
+
*/
|
|
21
|
+
export type InstantOrderProductsError = {
|
|
22
|
+
kind: "SUBSCRIPTION_NOT_FOUND";
|
|
23
|
+
} | {
|
|
24
|
+
kind: "NETWORK";
|
|
25
|
+
message?: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "UNKNOWN";
|
|
28
|
+
message?: string;
|
|
29
|
+
};
|
|
30
|
+
export type PlaceInstantOrderError =
|
|
31
|
+
/** The host adapter does not implement instant orders at all. */
|
|
32
|
+
{
|
|
33
|
+
kind: "UNSUPPORTED";
|
|
34
|
+
}
|
|
35
|
+
/** 409 — the request key is well-formed but belongs to another purchase. */
|
|
36
|
+
| {
|
|
37
|
+
kind: "DUPLICATE_REQUEST";
|
|
38
|
+
message?: string;
|
|
39
|
+
}
|
|
40
|
+
/** 429 — the subscription hit its hourly or daily instant-order cap. */
|
|
41
|
+
| {
|
|
42
|
+
kind: "RATE_LIMITED";
|
|
43
|
+
message?: string;
|
|
44
|
+
}
|
|
45
|
+
/** 400 — malformed items, or a shipping method the shop does not offer. */
|
|
46
|
+
| {
|
|
47
|
+
kind: "INVALID_REQUEST";
|
|
48
|
+
message?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 403 — the shop has the feature off, the product is not on the allowlist, or
|
|
52
|
+
* the subscription cannot carry an instant order.
|
|
53
|
+
*/
|
|
54
|
+
| {
|
|
55
|
+
kind: "REFUSED";
|
|
56
|
+
message?: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: "SUBSCRIPTION_NOT_FOUND";
|
|
59
|
+
} | {
|
|
60
|
+
kind: "NETWORK";
|
|
61
|
+
message?: string;
|
|
62
|
+
} | {
|
|
63
|
+
kind: "UNKNOWN";
|
|
64
|
+
message?: string;
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=instantOrderErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instantOrderErrors.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/instantOrderErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GACjC;IAAE,IAAI,EAAE,wBAAwB,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,MAAM,MAAM,sBAAsB;AAChC,iEAAiE;AAC/D;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE;AACzB,4EAA4E;GAC1E;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;AACjD,wEAAwE;GACtE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;AAC5C,2EAA2E;GACzE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;AAC/C;;;GAGG;GACD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,wBAAwB,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line-removal rules.
|
|
3
|
+
*
|
|
4
|
+
* A subscription whose every remaining line retires at the next renewal has
|
|
5
|
+
* nothing left to bill, so that renewal expires it. The customer must
|
|
6
|
+
* therefore never be able to remove the last line that actually renews
|
|
7
|
+
* (CS-2195). The "this is your last product" confirmation does not cover this:
|
|
8
|
+
* a subscription can hold several lines of which only one recurs.
|
|
9
|
+
*
|
|
10
|
+
* The rules live here, decoupled from any component, so every removal surface
|
|
11
|
+
* (the Edit Product overlay, the per-line menu in Upcoming Order Items)
|
|
12
|
+
* evaluates them identically and they stay unit tested.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The line shape the rules need.
|
|
16
|
+
*
|
|
17
|
+
* Identity is `subscriptionId` + `subscriptionLineId`, and both must be
|
|
18
|
+
* non-empty for a line to be removable at all: a schedule row generated from a
|
|
19
|
+
* plan rather than from an existing subscription line has no line to address,
|
|
20
|
+
* and those arrive with `null` or `""` rather than being omitted. Callers
|
|
21
|
+
* holding a different shape (e.g. `SubscriptionItem`, where `id` IS the
|
|
22
|
+
* subscription line id) project into this one.
|
|
23
|
+
*
|
|
24
|
+
* `id` is the host's own row id, used only to resolve box parents — a schedule
|
|
25
|
+
* row's `parentLineId` may reference either the parent's line id or its row id.
|
|
26
|
+
*/
|
|
27
|
+
export interface RemovableLine {
|
|
28
|
+
subscriptionId?: string | null;
|
|
29
|
+
subscriptionLineId?: string | null;
|
|
30
|
+
id?: string | null;
|
|
31
|
+
productId?: string | null;
|
|
32
|
+
/** Box grouping: parent subscription LINE id (primary). */
|
|
33
|
+
parentLineId?: string | null;
|
|
34
|
+
/** Box grouping: parent PRODUCT id (fallback). */
|
|
35
|
+
parentProductId?: string | null;
|
|
36
|
+
/** Normalized one-time flag, when the host already derived it. */
|
|
37
|
+
isOneTime?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Cycles left before the line retires; `1` means this is its last cycle.
|
|
40
|
+
* The blocks name for the wire's `renewalLimit`.
|
|
41
|
+
*/
|
|
42
|
+
recurringCycleLimit?: number | null;
|
|
43
|
+
}
|
|
44
|
+
/** The backend has already applied the current cycle to both signals. */
|
|
45
|
+
export declare function isOneTimeLine(line: RemovableLine): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* May the customer remove this line?
|
|
48
|
+
*
|
|
49
|
+
* `lines` may hold lines from other subscriptions (the schedule view
|
|
50
|
+
* aggregates several) — scoping happens here so no caller can forget it. The
|
|
51
|
+
* target must be an identified member of its own subscription's lines. A
|
|
52
|
+
* one-time can then always go; a recurring product can go only while another
|
|
53
|
+
* recurring product bucket remains in the same subscription.
|
|
54
|
+
*/
|
|
55
|
+
export declare function canRemoveLine(line: RemovableLine, lines: readonly RemovableLine[]): boolean;
|
|
56
|
+
//# sourceMappingURL=lineRemoval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineRemoval.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/lineRemoval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAE1D;AA8GD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,OAAO,CAiBT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineRemoval.test.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/lineRemoval.test.ts"],"names":[],"mappings":""}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* (`paymentMethodIcons` in `@juo/customer-ui`) is keyed that way.
|
|
20
20
|
*/
|
|
21
21
|
/** Instrument types, in the canonical underscore form. */
|
|
22
|
-
export declare const PAYMENT_INSTRUMENT_TYPES: readonly ["credit_card", "paypal", "shop_pay", "sepa_direct_debit", "blik", "mbway", "bacs"];
|
|
22
|
+
export declare const PAYMENT_INSTRUMENT_TYPES: readonly ["credit_card", "paypal", "shop_pay", "sepa_direct_debit", "blik", "mbway", "bacs", "manual"];
|
|
23
23
|
export type PaymentInstrumentType = (typeof PAYMENT_INSTRUMENT_TYPES)[number];
|
|
24
24
|
/**
|
|
25
25
|
* A payment instrument. Fields are required only where BOTH backend shapes
|
|
@@ -65,6 +65,13 @@ export type SubscriptionPaymentInstrument = {
|
|
|
65
65
|
} | {
|
|
66
66
|
type: "bacs";
|
|
67
67
|
maskedNumber: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* No vaulted instrument: the customer pays each renewal through Shopify
|
|
71
|
+
* Checkout. Carries no identifying data, so it renders name-only.
|
|
72
|
+
*/
|
|
73
|
+
| {
|
|
74
|
+
type: "manual";
|
|
68
75
|
};
|
|
69
76
|
/**
|
|
70
77
|
* Human-readable instrument name: the card brand for cards (which is the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentInstrument.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/paymentInstrument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"paymentInstrument.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/paymentInstrument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,wGAS3B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACrC;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACtD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IACE,IAAI,EAAE,mBAAmB,CAAC;IAC1B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,sEAAsE;IACtE,eAAe,EAAE,MAAM,CAAC;CACzB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE;AACxC;;;GAGG;GACD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAcvB;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,6BAA6B,GACxC,MAAM,CAQR;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,GACxC,MAAM,GAAG,IAAI,CAWf;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,GACxC,MAAM,GAAG,IAAI,CAaf;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,6BAA6B,EACzC,GAAG,GAAE,IAAiB,GACrB,uBAAuB,GAAG,IAAI,CAahC;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,OAAO,GACX,6BAA6B,GAAG,IAAI,CA0CtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAMV,mBAAmB,
|
|
1
|
+
{"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAMV,mBAAmB,EAGpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;CACsB,CAAC;AA2B9D,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,mBAAmB,CA6PrB"}
|