@quiltr/sdk 1.3.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.
- package/README.md +292 -0
- package/dist/client.d.ts +84 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +149 -0
- package/dist/client.js.map +1 -0
- package/dist/features/api-users/api-users.client.d.ts +52 -0
- package/dist/features/api-users/api-users.client.d.ts.map +1 -0
- package/dist/features/api-users/api-users.client.js +41 -0
- package/dist/features/api-users/api-users.client.js.map +1 -0
- package/dist/features/app-sessions/app-sessions.client.d.ts +22 -0
- package/dist/features/app-sessions/app-sessions.client.d.ts.map +1 -0
- package/dist/features/app-sessions/app-sessions.client.js +50 -0
- package/dist/features/app-sessions/app-sessions.client.js.map +1 -0
- package/dist/features/auth/auth.client.d.ts +32 -0
- package/dist/features/auth/auth.client.d.ts.map +1 -0
- package/dist/features/auth/auth.client.js +119 -0
- package/dist/features/auth/auth.client.js.map +1 -0
- package/dist/features/baskets/basket-operations.client.d.ts +89 -0
- package/dist/features/baskets/basket-operations.client.d.ts.map +1 -0
- package/dist/features/baskets/basket-operations.client.js +226 -0
- package/dist/features/baskets/basket-operations.client.js.map +1 -0
- package/dist/features/baskets/baskets.client.d.ts +10 -0
- package/dist/features/baskets/baskets.client.d.ts.map +1 -0
- package/dist/features/baskets/baskets.client.js +10 -0
- package/dist/features/baskets/baskets.client.js.map +1 -0
- package/dist/features/customers/customers.client.d.ts +10 -0
- package/dist/features/customers/customers.client.d.ts.map +1 -0
- package/dist/features/customers/customers.client.js +10 -0
- package/dist/features/customers/customers.client.js.map +1 -0
- package/dist/features/email-templates/email-templates.client.d.ts +9 -0
- package/dist/features/email-templates/email-templates.client.d.ts.map +1 -0
- package/dist/features/email-templates/email-templates.client.js +10 -0
- package/dist/features/email-templates/email-templates.client.js.map +1 -0
- package/dist/features/fascias/fascias.client.d.ts +9 -0
- package/dist/features/fascias/fascias.client.d.ts.map +1 -0
- package/dist/features/fascias/fascias.client.js +10 -0
- package/dist/features/fascias/fascias.client.js.map +1 -0
- package/dist/features/gift-cards/gift-card-operations.client.d.ts +24 -0
- package/dist/features/gift-cards/gift-card-operations.client.d.ts.map +1 -0
- package/dist/features/gift-cards/gift-card-operations.client.js +18 -0
- package/dist/features/gift-cards/gift-card-operations.client.js.map +1 -0
- package/dist/features/jobs/jobs.client.d.ts +20 -0
- package/dist/features/jobs/jobs.client.d.ts.map +1 -0
- package/dist/features/jobs/jobs.client.js +44 -0
- package/dist/features/jobs/jobs.client.js.map +1 -0
- package/dist/features/locations/locations.client.d.ts +9 -0
- package/dist/features/locations/locations.client.d.ts.map +1 -0
- package/dist/features/locations/locations.client.js +10 -0
- package/dist/features/locations/locations.client.js.map +1 -0
- package/dist/features/payments/payments.client.d.ts +22 -0
- package/dist/features/payments/payments.client.d.ts.map +1 -0
- package/dist/features/payments/payments.client.js +50 -0
- package/dist/features/payments/payments.client.js.map +1 -0
- package/dist/features/price-entries/price-entries.client.d.ts +9 -0
- package/dist/features/price-entries/price-entries.client.d.ts.map +1 -0
- package/dist/features/price-entries/price-entries.client.js +10 -0
- package/dist/features/price-entries/price-entries.client.js.map +1 -0
- package/dist/features/pricing/pricing.client.d.ts +20 -0
- package/dist/features/pricing/pricing.client.d.ts.map +1 -0
- package/dist/features/pricing/pricing.client.js +27 -0
- package/dist/features/pricing/pricing.client.js.map +1 -0
- package/dist/features/products/products.client.d.ts +20 -0
- package/dist/features/products/products.client.d.ts.map +1 -0
- package/dist/features/products/products.client.js +45 -0
- package/dist/features/products/products.client.js.map +1 -0
- package/dist/features/promotions/promotion.client.d.ts +33 -0
- package/dist/features/promotions/promotion.client.d.ts.map +1 -0
- package/dist/features/promotions/promotion.client.js +69 -0
- package/dist/features/promotions/promotion.client.js.map +1 -0
- package/dist/features/scripts/scripts.client.d.ts +17 -0
- package/dist/features/scripts/scripts.client.d.ts.map +1 -0
- package/dist/features/scripts/scripts.client.js +26 -0
- package/dist/features/scripts/scripts.client.js.map +1 -0
- package/dist/features/search/search.client.d.ts +17 -0
- package/dist/features/search/search.client.d.ts.map +1 -0
- package/dist/features/search/search.client.js +40 -0
- package/dist/features/search/search.client.js.map +1 -0
- package/dist/features/tasks/tasks.client.d.ts +9 -0
- package/dist/features/tasks/tasks.client.d.ts.map +1 -0
- package/dist/features/tasks/tasks.client.js +10 -0
- package/dist/features/tasks/tasks.client.js.map +1 -0
- package/dist/features/tax/tax-rule.client.d.ts +16 -0
- package/dist/features/tax/tax-rule.client.d.ts.map +1 -0
- package/dist/features/tax/tax-rule.client.js +18 -0
- package/dist/features/tax/tax-rule.client.js.map +1 -0
- package/dist/features/tenants/tenants.client.d.ts +21 -0
- package/dist/features/tenants/tenants.client.d.ts.map +1 -0
- package/dist/features/tenants/tenants.client.js +47 -0
- package/dist/features/tenants/tenants.client.js.map +1 -0
- package/dist/features/uploads/uploads.client.d.ts +21 -0
- package/dist/features/uploads/uploads.client.d.ts.map +1 -0
- package/dist/features/uploads/uploads.client.js +57 -0
- package/dist/features/uploads/uploads.client.js.map +1 -0
- package/dist/features/users/users.client.d.ts +9 -0
- package/dist/features/users/users.client.d.ts.map +1 -0
- package/dist/features/users/users.client.js +10 -0
- package/dist/features/users/users.client.js.map +1 -0
- package/dist/features/workflows/workflows.client.d.ts +38 -0
- package/dist/features/workflows/workflows.client.d.ts.map +1 -0
- package/dist/features/workflows/workflows.client.js +142 -0
- package/dist/features/workflows/workflows.client.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/shared/base-crud.client.d.ts +31 -0
- package/dist/shared/base-crud.client.d.ts.map +1 -0
- package/dist/shared/base-crud.client.js +97 -0
- package/dist/shared/base-crud.client.js.map +1 -0
- package/dist/shared/errors.d.ts +27 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +67 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/http-client.d.ts +56 -0
- package/dist/shared/http-client.d.ts.map +1 -0
- package/dist/shared/http-client.js +194 -0
- package/dist/shared/http-client.js.map +1 -0
- package/dist/shared/result.d.ts +15 -0
- package/dist/shared/result.d.ts.map +1 -0
- package/dist/shared/result.js +7 -0
- package/dist/shared/result.js.map +1 -0
- package/dist/shared/websocket.client.d.ts +40 -0
- package/dist/shared/websocket.client.d.ts.map +1 -0
- package/dist/shared/websocket.client.js +93 -0
- package/dist/shared/websocket.client.js.map +1 -0
- package/dist/types/common.types.d.ts +21 -0
- package/dist/types/common.types.d.ts.map +1 -0
- package/dist/types/common.types.js +5 -0
- package/dist/types/common.types.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/query-builder.d.ts +10 -0
- package/dist/utils/query-builder.d.ts.map +1 -0
- package/dist/utils/query-builder.js +33 -0
- package/dist/utils/query-builder.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email templates client - tenant-scoped CRUD for email templates.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
import type { EmailTemplate, CreateEmailTemplateDto, UpdateEmailTemplateDto, QueryEmailTemplateDto } from '../../types';
|
|
6
|
+
export declare class EmailTemplatesClient extends BaseCrudClient<EmailTemplate, CreateEmailTemplateDto, UpdateEmailTemplateDto, QueryEmailTemplateDto> {
|
|
7
|
+
constructor(http: ConstructorParameters<typeof BaseCrudClient>[0]);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=email-templates.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-templates.client.d.ts","sourceRoot":"","sources":["../../../src/features/email-templates/email-templates.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAExH,qBAAa,oBAAqB,SAAQ,cAAc,CAAC,aAAa,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,CAAC;gBAChI,IAAI,EAAE,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;CAGlE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email templates client - tenant-scoped CRUD for email templates.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
export class EmailTemplatesClient extends BaseCrudClient {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
super(http, '/api/v1/email-templates');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=email-templates.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-templates.client.js","sourceRoot":"","sources":["../../../src/features/email-templates/email-templates.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,MAAM,OAAO,oBAAqB,SAAQ,cAAoG;IAC5I,YAAY,IAAqD;QAC/D,KAAK,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fascias client - tenant-scoped CRUD for fascias (brands/sub-brands).
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
import type { Fascia, CreateFasciaDto, UpdateFasciaDto, QueryFasciaDto } from '../../types';
|
|
6
|
+
export declare class FasciasClient extends BaseCrudClient<Fascia, CreateFasciaDto, UpdateFasciaDto, QueryFasciaDto> {
|
|
7
|
+
constructor(http: ConstructorParameters<typeof BaseCrudClient>[0]);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=fascias.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fascias.client.d.ts","sourceRoot":"","sources":["../../../src/features/fascias/fascias.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5F,qBAAa,aAAc,SAAQ,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,CAAC;gBAC7F,IAAI,EAAE,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;CAGlE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fascias client - tenant-scoped CRUD for fascias (brands/sub-brands).
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
export class FasciasClient extends BaseCrudClient {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
super(http, '/api/v1/fascias');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=fascias.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fascias.client.js","sourceRoot":"","sources":["../../../src/features/fascias/fascias.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,MAAM,OAAO,aAAc,SAAQ,cAAwE;IACzG,YAAY,IAAqD;QAC/D,KAAK,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gift card operations client — lookup by card number.
|
|
3
|
+
*/
|
|
4
|
+
import type { HttpClient } from '../../shared/http-client';
|
|
5
|
+
import type { Result } from '../../shared/result';
|
|
6
|
+
import type { SdkError } from '../../shared/errors';
|
|
7
|
+
export interface GiftCardLookupResult {
|
|
8
|
+
_id: string;
|
|
9
|
+
cardNumber: string;
|
|
10
|
+
balance: number;
|
|
11
|
+
currency?: string;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
expiryDate?: string;
|
|
14
|
+
customerId?: string;
|
|
15
|
+
transactions?: Array<Record<string, unknown>>;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare class GiftCardOperationsClient {
|
|
19
|
+
private readonly http;
|
|
20
|
+
constructor(http: HttpClient);
|
|
21
|
+
/** Look up a gift card by card number. Returns the full card with balance. */
|
|
22
|
+
lookup(cardNumber: string): Promise<Result<GiftCardLookupResult, SdkError>>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=gift-card-operations.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gift-card-operations.client.d.ts","sourceRoot":"","sources":["../../../src/features/gift-cards/gift-card-operations.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qBAAa,wBAAwB;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,8EAA8E;IACxE,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;CAMlF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gift card operations client — lookup by card number.
|
|
3
|
+
*/
|
|
4
|
+
const BASE_PATH = '/api/v1/gift-cards';
|
|
5
|
+
export class GiftCardOperationsClient {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
/** Look up a gift card by card number. Returns the full card with balance. */
|
|
11
|
+
async lookup(cardNumber) {
|
|
12
|
+
return this.http.request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
path: `${BASE_PATH}/lookup/${encodeURIComponent(cardNumber)}`,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=gift-card-operations.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gift-card-operations.client.js","sourceRoot":"","sources":["../../../src/features/gift-cards/gift-card-operations.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAcvC,MAAM,OAAO,wBAAwB;IACN;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,8EAA8E;IAC9E,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAuB;YAC7C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,SAAS,WAAW,kBAAkB,CAAC,UAAU,CAAC,EAAE;SAC9D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jobs client - query and manage background jobs.
|
|
3
|
+
*/
|
|
4
|
+
import type { HttpClient } from '../../shared/http-client';
|
|
5
|
+
import type { Result } from '../../shared/result';
|
|
6
|
+
import type { SdkError } from '../../shared/errors';
|
|
7
|
+
import type { PaginatedResult, Job, QueryJobDto } from '../../types';
|
|
8
|
+
export declare class JobsClient {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: HttpClient);
|
|
11
|
+
findAll(params?: QueryJobDto): Promise<Result<PaginatedResult<Job>, SdkError>>;
|
|
12
|
+
findOne(id: string): Promise<Result<Job, SdkError>>;
|
|
13
|
+
cancel(id: string): Promise<Result<Job, SdkError>>;
|
|
14
|
+
/** Poll a job until it reaches a terminal state */
|
|
15
|
+
waitForCompletion(id: string, options?: {
|
|
16
|
+
intervalMs?: number;
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
}): Promise<Result<Job, SdkError>>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=jobs.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.client.d.ts","sourceRoot":"","sources":["../../../src/features/jobs/jobs.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAKrE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEvC,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;IAQ9E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAInD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAIxD,mDAAmD;IAC7C,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GACpD,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;CAqBlC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jobs client - query and manage background jobs.
|
|
3
|
+
*/
|
|
4
|
+
import { buildQueryParams } from '../../utils/query-builder';
|
|
5
|
+
const BASE_PATH = '/api/v1/jobs';
|
|
6
|
+
export class JobsClient {
|
|
7
|
+
http;
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.http = http;
|
|
10
|
+
}
|
|
11
|
+
async findAll(params) {
|
|
12
|
+
return this.http.request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
path: BASE_PATH,
|
|
15
|
+
query: buildQueryParams(params),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async findOne(id) {
|
|
19
|
+
return this.http.request({ method: 'GET', path: `${BASE_PATH}/${id}` });
|
|
20
|
+
}
|
|
21
|
+
async cancel(id) {
|
|
22
|
+
return this.http.request({ method: 'PATCH', path: `${BASE_PATH}/${id}/cancel` });
|
|
23
|
+
}
|
|
24
|
+
/** Poll a job until it reaches a terminal state */
|
|
25
|
+
async waitForCompletion(id, options) {
|
|
26
|
+
const interval = options?.intervalMs ?? 1000;
|
|
27
|
+
const timeout = options?.timeoutMs ?? 60000;
|
|
28
|
+
const startTime = Date.now();
|
|
29
|
+
while (Date.now() - startTime < timeout) {
|
|
30
|
+
const result = await this.findOne(id);
|
|
31
|
+
if (!result.success)
|
|
32
|
+
return result;
|
|
33
|
+
const terminalStates = ['completed', 'failed', 'cancelled'];
|
|
34
|
+
if (terminalStates.includes(result.data.status)) {
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
await new Promise(resolve => setTimeout(resolve, interval));
|
|
38
|
+
}
|
|
39
|
+
const { failure } = await import('../../shared/result');
|
|
40
|
+
const { SdkError: SdkErrorClass } = await import('../../shared/errors');
|
|
41
|
+
return failure(new SdkErrorClass(`Job ${id} did not complete within ${timeout}ms`, undefined, 'TIMEOUT'));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=jobs.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.client.js","sourceRoot":"","sources":["../../../src/features/jobs/jobs.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,MAAM,OAAO,UAAU;IACQ;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,MAAoB;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,MA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@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locations client - tenant-scoped CRUD for physical locations.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
import type { Location, CreateLocationDto, UpdateLocationDto, QueryLocationDto } from '../../types';
|
|
6
|
+
export declare class LocationsClient extends BaseCrudClient<Location, CreateLocationDto, UpdateLocationDto, QueryLocationDto> {
|
|
7
|
+
constructor(http: ConstructorParameters<typeof BaseCrudClient>[0]);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=locations.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.client.d.ts","sourceRoot":"","sources":["../../../src/features/locations/locations.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpG,qBAAa,eAAgB,SAAQ,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC;gBACvG,IAAI,EAAE,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;CAGlE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locations client - tenant-scoped CRUD for physical locations.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
export class LocationsClient extends BaseCrudClient {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
super(http, '/api/v1/locations');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=locations.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.client.js","sourceRoot":"","sources":["../../../src/features/locations/locations.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,MAAM,OAAO,eAAgB,SAAQ,cAAgF;IACnH,YAAY,IAAqD;QAC/D,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payments client - full payment lifecycle.
|
|
3
|
+
*/
|
|
4
|
+
import type { HttpClient } from '../../shared/http-client';
|
|
5
|
+
import type { Result } from '../../shared/result';
|
|
6
|
+
import type { SdkError } from '../../shared/errors';
|
|
7
|
+
import type { PaginatedResult, Payment, CreatePaymentDto, RefundPaymentDto, CreatePaymentLinkDto, ConfigurePaymentDto, PaymentConfig, QueryPaymentDto } from '../../types';
|
|
8
|
+
export declare class PaymentsClient {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: HttpClient);
|
|
11
|
+
findAll(params?: QueryPaymentDto): Promise<Result<PaginatedResult<Payment>, SdkError>>;
|
|
12
|
+
findOne(id: string): Promise<Result<Payment, SdkError>>;
|
|
13
|
+
create(dto: CreatePaymentDto): Promise<Result<Payment, SdkError>>;
|
|
14
|
+
capture(id: string): Promise<Result<Payment, SdkError>>;
|
|
15
|
+
refund(id: string, dto?: RefundPaymentDto): Promise<Result<Payment, SdkError>>;
|
|
16
|
+
createLink(dto: CreatePaymentLinkDto): Promise<Result<Payment, SdkError>>;
|
|
17
|
+
sendLink(id: string): Promise<Result<void, SdkError>>;
|
|
18
|
+
getStatus(id: string): Promise<Result<Payment, SdkError>>;
|
|
19
|
+
getConfig(): Promise<Result<PaymentConfig, SdkError>>;
|
|
20
|
+
configure(dto: ConfigurePaymentDto): Promise<Result<void, SdkError>>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=payments.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.client.d.ts","sourceRoot":"","sources":["../../../src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M,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAIzD,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAIrD,SAAS,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;CAG3E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payments client - full payment lifecycle.
|
|
3
|
+
*/
|
|
4
|
+
import { buildQueryParams } from '../../utils/query-builder';
|
|
5
|
+
const BASE_PATH = '/api/v1/payments';
|
|
6
|
+
export class PaymentsClient {
|
|
7
|
+
http;
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.http = http;
|
|
10
|
+
}
|
|
11
|
+
async findAll(params) {
|
|
12
|
+
return this.http.request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
path: BASE_PATH,
|
|
15
|
+
query: buildQueryParams(params),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async findOne(id) {
|
|
19
|
+
return this.http.request({ method: 'GET', path: `${BASE_PATH}/${id}` });
|
|
20
|
+
}
|
|
21
|
+
async create(dto) {
|
|
22
|
+
return this.http.request({ method: 'POST', path: BASE_PATH, body: dto });
|
|
23
|
+
}
|
|
24
|
+
async capture(id) {
|
|
25
|
+
return this.http.request({ method: 'POST', path: `${BASE_PATH}/${id}/capture` });
|
|
26
|
+
}
|
|
27
|
+
async refund(id, dto) {
|
|
28
|
+
return this.http.request({
|
|
29
|
+
method: 'POST',
|
|
30
|
+
path: `${BASE_PATH}/${id}/refund`,
|
|
31
|
+
body: dto,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async createLink(dto) {
|
|
35
|
+
return this.http.request({ method: 'POST', path: `${BASE_PATH}/link`, body: dto });
|
|
36
|
+
}
|
|
37
|
+
async sendLink(id) {
|
|
38
|
+
return this.http.request({ method: 'POST', path: `${BASE_PATH}/${id}/send-link` });
|
|
39
|
+
}
|
|
40
|
+
async getStatus(id) {
|
|
41
|
+
return this.http.request({ method: 'GET', path: `${BASE_PATH}/${id}/status` });
|
|
42
|
+
}
|
|
43
|
+
async getConfig() {
|
|
44
|
+
return this.http.request({ method: 'GET', path: `${BASE_PATH}/config` });
|
|
45
|
+
}
|
|
46
|
+
async configure(dto) {
|
|
47
|
+
return this.http.request({ method: 'POST', path: `${BASE_PATH}/config`, body: dto });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=payments.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.client.js","sourceRoot":"","sources":["../../../src/features/payments/payments.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAErC,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,MAAwB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAqB;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,C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,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IACvF,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Price entries client - tenant-scoped CRUD for price entries.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
import type { PriceEntry, CreatePriceEntryDto, UpdatePriceEntryDto, QueryPriceEntryDto } from '../../types';
|
|
6
|
+
export declare class PriceEntriesClient extends BaseCrudClient<PriceEntry, CreatePriceEntryDto, UpdatePriceEntryDto, QueryPriceEntryDto> {
|
|
7
|
+
constructor(http: ConstructorParameters<typeof BaseCrudClient>[0]);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=price-entries.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-entries.client.d.ts","sourceRoot":"","sources":["../../../src/features/price-entries/price-entries.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE5G,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,CAAC;gBAClH,IAAI,EAAE,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;CAGlE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Price entries client - tenant-scoped CRUD for price entries.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
export class PriceEntriesClient extends BaseCrudClient {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
super(http, '/api/v1/price-entries');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=price-entries.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-entries.client.js","sourceRoot":"","sources":["../../../src/features/price-entries/price-entries.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,MAAM,OAAO,kBAAmB,SAAQ,cAAwF;IAC9H,YAAY,IAAqD;QAC/D,KAAK,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pricing client - dynamic price resolution.
|
|
3
|
+
*/
|
|
4
|
+
import type { HttpClient } from '../../shared/http-client';
|
|
5
|
+
import type { Result } from '../../shared/result';
|
|
6
|
+
import type { SdkError } from '../../shared/errors';
|
|
7
|
+
import type { PriceContext, ResolvedPrice } from '../../types';
|
|
8
|
+
export declare class PricingClient {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: HttpClient);
|
|
11
|
+
/** Resolve the price for a single product given a context. */
|
|
12
|
+
resolvePrice(productId: string, context: PriceContext): Promise<Result<{
|
|
13
|
+
price: ResolvedPrice | null;
|
|
14
|
+
}, SdkError>>;
|
|
15
|
+
/** Batch resolve prices for multiple products (max 200). */
|
|
16
|
+
resolvePrices(productIds: string[], context: PriceContext): Promise<Result<{
|
|
17
|
+
prices: Record<string, ResolvedPrice>;
|
|
18
|
+
}, SdkError>>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=pricing.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.client.d.ts","sourceRoot":"","sources":["../../../src/features/pricing/pricing.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI/D,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,8DAA8D;IACxD,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC;QAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC;IAQ7D,4DAA4D;IACtD,aAAa,CACjB,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC;CAOxE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pricing client - dynamic price resolution.
|
|
3
|
+
*/
|
|
4
|
+
const BASE_PATH = '/api/v1/prices';
|
|
5
|
+
export class PricingClient {
|
|
6
|
+
http;
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
/** Resolve the price for a single product given a context. */
|
|
11
|
+
async resolvePrice(productId, context) {
|
|
12
|
+
return this.http.request({
|
|
13
|
+
method: 'POST',
|
|
14
|
+
path: `${BASE_PATH}/resolve/${productId}`,
|
|
15
|
+
body: { context },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** Batch resolve prices for multiple products (max 200). */
|
|
19
|
+
async resolvePrices(productIds, context) {
|
|
20
|
+
return this.http.request({
|
|
21
|
+
method: 'POST',
|
|
22
|
+
path: `${BASE_PATH}/resolve`,
|
|
23
|
+
body: { productIds, context },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=pricing.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.client.js","sourceRoot":"","sources":["../../../src/features/pricing/pricing.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC,MAAM,OAAO,aAAa;IACK;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,8DAA8D;IAC9D,KAAK,CAAC,YAAY,CAChB,SAAiB,EACjB,OAAqB;QAErB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,GAAG,SAAS,YAAY,SAAS,EAAE;YACzC,IAAI,EAAE,EAAE,OAAO,EAAE;SAClB,CAAC,CAAC;IACL,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,aAAa,CACjB,UAAoB,EACpB,OAAqB;QAErB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,GAAG,SAAS,UAAU;YAC5B,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE;SAC9B,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Products CRUD client with variant lookup methods.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
import type { HttpClient } from '../../shared/http-client';
|
|
6
|
+
import type { Result } from '../../shared/result';
|
|
7
|
+
import type { SdkError } from '../../shared/errors';
|
|
8
|
+
import type { Product, CreateProductDto, UpdateProductDto, QueryProductDto } from '../../types';
|
|
9
|
+
export declare class ProductsClient extends BaseCrudClient<Product, CreateProductDto, UpdateProductDto, QueryProductDto> {
|
|
10
|
+
constructor(http: HttpClient);
|
|
11
|
+
/** Find a full product by ID with variant data. */
|
|
12
|
+
findFullProductById(id: string): Promise<Result<Product, SdkError>>;
|
|
13
|
+
/** Find a product by SKU. */
|
|
14
|
+
findBySKU(sku: string): Promise<Result<Product, SdkError>>;
|
|
15
|
+
/** Find a product by GTIN/barcode. */
|
|
16
|
+
findByGTIN(gtin: string): Promise<Result<Product, SdkError>>;
|
|
17
|
+
/** Find a variant by parent product ID and attribute properties. */
|
|
18
|
+
findByProps(productId: string, props: Record<string, string>, clientEnv?: Record<string, unknown>): Promise<Result<Product, SdkError>>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=products.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.client.d.ts","sourceRoot":"","sources":["../../../src/features/products/products.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhG,qBAAa,cAAe,SAAQ,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,CAAC;gBAClG,IAAI,EAAE,UAAU;IAI5B,mDAAmD;IAC7C,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAOzE,6BAA6B;IACvB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAOhE,sCAAsC;IAChC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAOlE,oEAAoE;IAC9D,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;CAatC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Products CRUD client with variant lookup methods.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
export class ProductsClient extends BaseCrudClient {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
super(http, '/api/v1/products');
|
|
8
|
+
}
|
|
9
|
+
/** Find a full product by ID with variant data. */
|
|
10
|
+
async findFullProductById(id) {
|
|
11
|
+
return this.http.request({
|
|
12
|
+
method: 'GET',
|
|
13
|
+
path: `${this.basePath}/findFullProductById/${id}`,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Find a product by SKU. */
|
|
17
|
+
async findBySKU(sku) {
|
|
18
|
+
return this.http.request({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
path: `${this.basePath}/findFullProductBySKU/${sku}`,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** Find a product by GTIN/barcode. */
|
|
24
|
+
async findByGTIN(gtin) {
|
|
25
|
+
return this.http.request({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
path: `${this.basePath}/findFullProductByGTIN/${gtin}`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Find a variant by parent product ID and attribute properties. */
|
|
31
|
+
async findByProps(productId, props, clientEnv) {
|
|
32
|
+
const query = {
|
|
33
|
+
props: JSON.stringify(props),
|
|
34
|
+
};
|
|
35
|
+
if (clientEnv) {
|
|
36
|
+
query.clientEnv = JSON.stringify(clientEnv);
|
|
37
|
+
}
|
|
38
|
+
return this.http.request({
|
|
39
|
+
method: 'GET',
|
|
40
|
+
path: `${this.basePath}/findFullProductByProps/${productId}`,
|
|
41
|
+
query,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=products.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.client.js","sourceRoot":"","sources":["../../../src/features/products/products.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAM/D,MAAM,OAAO,cAAe,SAAQ,cAA4E;IAC9G,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAED,mDAAmD;IACnD,KAAK,CAAC,mBAAmB,CAAC,EAAU;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,wBAAwB,EAAE,EAAE;SACnD,CAAC,CAAC;IACL,CAAC;IAED,6BAA6B;IAC7B,KAAK,CAAC,SAAS,CAAC,GAAW;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,yBAAyB,GAAG,EAAE;SACrD,CAAC,CAAC;IACL,CAAC;IAED,sCAAsC;IACtC,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,0BAA0B,IAAI,EAAE;SACvD,CAAC,CAAC;IACL,CAAC;IAED,oEAAoE;IACpE,KAAK,CAAC,WAAW,CACf,SAAiB,EACjB,KAA6B,EAC7B,SAAmC;QAEnC,MAAM,KAAK,GAA4B;YACrC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;SAC7B,CAAC;QACF,IAAI,SAAS,EAAE,CAAC;YACd,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,2BAA2B,SAAS,EAAE;YAC5D,KAAK;SACN,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promotion client — CRUD and operations for promotions.
|
|
3
|
+
*/
|
|
4
|
+
import type { HttpClient } from '../../shared/http-client';
|
|
5
|
+
import type { Result } from '../../shared/result';
|
|
6
|
+
import type { SdkError } from '../../shared/errors';
|
|
7
|
+
import type { Promotion, CreatePromotionDto, UpdatePromotionDto, PromotionResult } from '../../types';
|
|
8
|
+
export declare class PromotionClient {
|
|
9
|
+
private readonly http;
|
|
10
|
+
private readonly basePath;
|
|
11
|
+
constructor(http: HttpClient);
|
|
12
|
+
list(params?: Record<string, unknown>): Promise<Result<Promotion[], SdkError>>;
|
|
13
|
+
get(id: string): Promise<Result<Promotion, SdkError>>;
|
|
14
|
+
create(dto: CreatePromotionDto): Promise<Result<Promotion, SdkError>>;
|
|
15
|
+
update(id: string, dto: UpdatePromotionDto): Promise<Result<Promotion, SdkError>>;
|
|
16
|
+
delete(id: string): Promise<Result<void, SdkError>>;
|
|
17
|
+
/** Evaluate all applicable promotions for a basket (preview, does not apply). */
|
|
18
|
+
evaluate(basket: Record<string, unknown>): Promise<Result<{
|
|
19
|
+
data: PromotionResult[];
|
|
20
|
+
}, SdkError>>;
|
|
21
|
+
/** Validate a specific promotion against a basket context. */
|
|
22
|
+
validate(promotionId: string, basket: Record<string, unknown>): Promise<Result<{
|
|
23
|
+
valid: boolean;
|
|
24
|
+
discountAmountInCents?: number;
|
|
25
|
+
reason?: string;
|
|
26
|
+
}, SdkError>>;
|
|
27
|
+
/** Look up a promotion by coupon code. */
|
|
28
|
+
lookupCoupon(code: string): Promise<Result<{
|
|
29
|
+
found: boolean;
|
|
30
|
+
data?: Promotion;
|
|
31
|
+
}, SdkError>>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=promotion.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promotion.client.d.ts","sourceRoot":"","sources":["../../../src/features/promotions/promotion.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAGd,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;gBAEpB,IAAI,EAAE,UAAU;IAIvC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC;IAQ9E,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAOrD,MAAM,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAQrE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAQjF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IASzD,iFAAiF;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,IAAI,EAAE,eAAe,EAAE,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC;IAQvG,8DAA8D;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC;IAQpK,0CAA0C;IACpC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC;CAMlG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promotion client — CRUD and operations for promotions.
|
|
3
|
+
*/
|
|
4
|
+
export class PromotionClient {
|
|
5
|
+
http;
|
|
6
|
+
basePath = '/api/v1/promotions';
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
// --- CRUD ---
|
|
11
|
+
async list(params) {
|
|
12
|
+
return this.http.request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
path: this.basePath,
|
|
15
|
+
query: params,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async get(id) {
|
|
19
|
+
return this.http.request({
|
|
20
|
+
method: 'GET',
|
|
21
|
+
path: `${this.basePath}/${id}`,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async create(dto) {
|
|
25
|
+
return this.http.request({
|
|
26
|
+
method: 'POST',
|
|
27
|
+
path: this.basePath,
|
|
28
|
+
body: dto,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async update(id, dto) {
|
|
32
|
+
return this.http.request({
|
|
33
|
+
method: 'PATCH',
|
|
34
|
+
path: `${this.basePath}/${id}`,
|
|
35
|
+
body: dto,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async delete(id) {
|
|
39
|
+
return this.http.request({
|
|
40
|
+
method: 'DELETE',
|
|
41
|
+
path: `${this.basePath}/${id}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
// --- Operations ---
|
|
45
|
+
/** Evaluate all applicable promotions for a basket (preview, does not apply). */
|
|
46
|
+
async evaluate(basket) {
|
|
47
|
+
return this.http.request({
|
|
48
|
+
method: 'POST',
|
|
49
|
+
path: `${this.basePath}/evaluate`,
|
|
50
|
+
body: { basket },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Validate a specific promotion against a basket context. */
|
|
54
|
+
async validate(promotionId, basket) {
|
|
55
|
+
return this.http.request({
|
|
56
|
+
method: 'POST',
|
|
57
|
+
path: `${this.basePath}/${promotionId}/validate`,
|
|
58
|
+
body: { basket },
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Look up a promotion by coupon code. */
|
|
62
|
+
async lookupCoupon(code) {
|
|
63
|
+
return this.http.request({
|
|
64
|
+
method: 'GET',
|
|
65
|
+
path: `${this.basePath}/lookup/${encodeURIComponent(code)}`,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=promotion.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promotion.client.js","sourceRoot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AED,qBAAqB;IAErB,iFAAiF;IACjF,KAAK,CAAC,QAAQ,CAAC,MAA+B;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA8B;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,WAAW;YACjC,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IAED,8DAA8D;IAC9D,KAAK,CAAC,QAAQ,CAAC,WAAmB,EAAE,MAA+B;QACjE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAsE;YAC5F,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,WAAW,WAAW;YAChD,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IAED,0CAA0C;IAC1C,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAuC;YAC7D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,WAAW,kBAAkB,CAAC,IAAI,CAAC,EAAE;SAC5D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scripts client - tenant-scoped CRUD + execute and validate.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseCrudClient } from '../../shared/base-crud.client';
|
|
5
|
+
import type { Result } from '../../shared/result';
|
|
6
|
+
import type { SdkError } from '../../shared/errors';
|
|
7
|
+
import type { Script, CreateScriptDto, UpdateScriptDto, QueryScriptDto, ExecuteScriptDto, ScriptValidationResult } from '../../types';
|
|
8
|
+
export declare class ScriptsClient extends BaseCrudClient<Script, CreateScriptDto, UpdateScriptDto, QueryScriptDto> {
|
|
9
|
+
constructor(http: ConstructorParameters<typeof BaseCrudClient>[0]);
|
|
10
|
+
/** Execute a script asynchronously. Returns a jobId to poll for results. */
|
|
11
|
+
execute(id: string, dto?: ExecuteScriptDto): Promise<Result<{
|
|
12
|
+
jobId: string;
|
|
13
|
+
}, SdkError>>;
|
|
14
|
+
/** Validate a script's syntax without executing it. */
|
|
15
|
+
validate(id: string): Promise<Result<ScriptValidationResult, SdkError>>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=scripts.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.client.d.ts","sourceRoot":"","sources":["../../../src/features/scripts/scripts.client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EACV,MAAM,EACN,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAIrB,qBAAa,aAAc,SAAQ,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,CAAC;gBAC7F,IAAI,EAAE,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;IAIjE,4EAA4E;IACtE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC;IAQ/F,uDAAuD;IACjD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;CAM9E"}
|