@qonto/embed-sdk 0.24.0 → 0.25.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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The paymentLinks namespace contains all the functions related to paymentLinks
3
+ * operations. It can be accessed like this:
4
+ * ```ts
5
+ * import { paymentLinks } from '@qonto/embed-sdk/paymentLinks';
6
+ * ```
7
+ *
8
+ * Then, the paymentLinks object contains the functions to perform paymentLinks
9
+ * operations:
10
+ * ```ts
11
+ * const url = paymentLinks.getCreatePaymentLinkFlowUrl({accessToken, items, redirectUrl});
12
+ * window.open(url, '_blank');
13
+ * ```
14
+ */
15
+ export declare const paymentLinks: {
16
+ getCreatePaymentLinkFlowUrl: ({ paymentLinkSettings, operationSettings, }: import("./payment-links.types").PaymentLinkParams<import("./payment-links.types").CreatePaymentLinkSettings>) => string;
17
+ };
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/payment-links/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY;;CAAqC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { CreatePaymentLinkSettings, PaymentLinkParams } from './payment-links.types';
2
+ /**
3
+ * Generates the URL for initiating a payment link creation flow with specified items.
4
+ *
5
+ * @param params - An object containing:
6
+ * - paymentLinkSettings: An object containing:
7
+ * - items: An array of items to be included in the payment link. Each item must conform to the Item type and will be validated.
8
+ * - redirectUrl: The URL to which the user will be redirected after completing the payment link flow. This will be validated for correctness.
9
+ * - operationSettings (optional): An object containing:
10
+ * - accessToken: The authentication token. If not provided, the function requires that authentication has already been initialized.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const url = getCreatePaymentLinkFlowUrl({
15
+ * paymentLinkSettings: {
16
+ * items: [{ id: '1', title: 'Item 1', type: 'product', quantity: 1, measureUnit: 'unit', unitPrice: { currency: 'EUR', value: 10 }, vatRate: '20' }],
17
+ * redirectUrl: 'https://www.example.com',
18
+ * },
19
+ * operationSettings: {
20
+ * accessToken: 'your-access-token',
21
+ * },
22
+ * });
23
+ * ```
24
+ * @returns The full URL as a string, which can be used to launch the payment link creation flow in an iframe or browser.
25
+ *
26
+ * @throws \{InvalidParametersError\} If the provided items array or redirectUrl is invalid.
27
+ * @throws \{AuthenticationError\} If the access token is missing or invalid, and initialize has not been called.
28
+ *
29
+ * @remarks Ensure initialize has been called before calling this function if you do not provide an accessToken.
30
+ */
31
+ export declare const getCreatePaymentLinkFlowUrl: ({ paymentLinkSettings, operationSettings, }: PaymentLinkParams<CreatePaymentLinkSettings>) => string;
32
+ //# sourceMappingURL=payment-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../src/payment-links/payment-links.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAU/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,2BAA2B,GAAI,6CAGzC,iBAAiB,CAAC,yBAAyB,CAAC,WAe9C,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare const paymentLinks: {
2
+ getCreatePaymentLinkFlowUrl: ({ paymentLinkSettings, operationSettings, }: import("./payment-links.types").PaymentLinkParams<import("./payment-links.types").CreatePaymentLinkSettings>) => string;
3
+ };
4
+ export { paymentLinks };
5
+ //# sourceMappingURL=payment-links.public-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-links.public-api.d.ts","sourceRoot":"","sources":["../../src/payment-links/payment-links.public-api.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY;;CAEjB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=payment-links.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-links.test.d.ts","sourceRoot":"","sources":["../../src/payment-links/payment-links.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import type { OperationSettings } from '@validation/operation-settings-validation';
2
+ export interface Item {
3
+ id: string;
4
+ title: string;
5
+ type: string;
6
+ description?: string;
7
+ quantity: number;
8
+ measureUnit: string;
9
+ unitPrice: Amount<string>;
10
+ vatRate: string;
11
+ }
12
+ interface Amount<T = number> {
13
+ currency: string;
14
+ value: T;
15
+ }
16
+ export interface CreatePaymentLinkSettings {
17
+ items?: Item[];
18
+ redirectUrl: string;
19
+ }
20
+ export interface PaymentLinkParams<T> {
21
+ paymentLinkSettings: T;
22
+ operationSettings?: OperationSettings;
23
+ }
24
+ export declare const LINK_TYPES: {
25
+ GOOD: string;
26
+ SERVICE: string;
27
+ };
28
+ export {};
29
+ //# sourceMappingURL=payment-links.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-links.types.d.ts","sourceRoot":"","sources":["../../src/payment-links/payment-links.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,MAAM,CAAC,CAAC,GAAG,MAAM;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,CAAC,CAAC;CACV;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,mBAAmB,EAAE,CAAC,CAAC;IACvB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const validateCurrency: (currency: string) => void;
2
+ //# sourceMappingURL=currency.validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.validation.d.ts","sourceRoot":"","sources":["../../../src/payment-links/validation/currency.validation.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,SAMhD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type Item } from '../payment-links.types';
2
+ export declare function validateItems(items: Item[] | undefined): never[] | undefined;
3
+ export declare function validateRedirectUrl(redirectUrl: string): void;
4
+ export declare const validateType: (type: string) => void;
5
+ //# sourceMappingURL=payment-links.validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-links.validate.d.ts","sourceRoot":"","sources":["../../../src/payment-links/validation/payment-links.validate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAgB/D,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,uBAqCtD;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,QAetD;AAED,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,SAOxC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const validateUnit: (unit: string) => void;
2
+ //# sourceMappingURL=unit.validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit.validation.d.ts","sourceRoot":"","sources":["../../../src/payment-links/validation/unit.validation.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,SAMxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qonto/embed-sdk",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Library to embed Qonto features in your application",
5
5
  "type": "module",
6
6
  "exports": {
@@ -29,6 +29,10 @@
29
29
  "types": "./dist/organizations/index.d.ts",
30
30
  "import": "./dist/src/organizations/index.js"
31
31
  },
32
+ "./payment-links": {
33
+ "types": "./dist/payment-links/index.d.ts",
34
+ "import": "./dist/src/payment-links/index.js"
35
+ },
32
36
  "./types": {
33
37
  "types": "./dist/types/index.d.ts",
34
38
  "import": "./dist/src/types/index.js"