@cimplify/sdk 0.100.2 → 0.100.4
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 +17 -0
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-6JEKKL3M.js → chunk-3HU5I5VG.js} +23 -4
- package/dist/{chunk-YWNJJO2U.mjs → chunk-HSDQWJLA.mjs} +2 -2
- package/dist/{chunk-IJI7KMTG.js → chunk-JEVCHTKZ.js} +256 -74
- package/dist/{chunk-QRBBSIAY.js → chunk-LMD7B33E.js} +4 -4
- package/dist/{chunk-IFAQLFAJ.js → chunk-PNTINRAU.js} +33 -3
- package/dist/{chunk-B2YOCOLH.mjs → chunk-RQPXLXB2.mjs} +33 -3
- package/dist/{chunk-PJUXAUM2.mjs → chunk-RWR7JF7F.mjs} +210 -28
- package/dist/{chunk-TIQLOH2B.mjs → chunk-Z7M6GAHS.mjs} +23 -4
- package/dist/{client-D8XcrONA.d.mts → client-BwRAAk4y.d.mts} +26 -2
- package/dist/{client-CgXkRu2o.d.ts → client-CPcZIrjC.d.ts} +2 -2
- package/dist/{client-LPg_AUUr.d.ts → client-CrPglBBz.d.ts} +26 -2
- package/dist/{client-C6wb92AD.d.mts → client-DGrvLiJv.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +69 -69
- package/dist/index.mjs +3 -3
- package/dist/lint-rules.json +1 -0
- package/dist/lint.d.mts +537 -0
- package/dist/lint.d.ts +537 -0
- package/dist/lint.js +540 -0
- package/dist/lint.mjs +524 -0
- package/dist/mock/cli.mjs +33 -3
- package/dist/mock/library.js +33 -3
- package/dist/mock/library.mjs +33 -3
- package/dist/mock/msw.js +33 -3
- package/dist/mock/msw.mjs +33 -3
- package/dist/react.d.mts +10 -5
- package/dist/react.d.ts +10 -5
- package/dist/react.js +40 -35
- package/dist/react.mjs +14 -9
- package/dist/{server--RyVAfPN.d.mts → server-DRAW2OOX.d.mts} +7 -4
- package/dist/{server-CNyy47HL.d.ts → server-zyrpzJVn.d.ts} +7 -4
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +7 -7
- package/dist/server.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/testing/msw.d.mts +1 -1
- package/dist/testing/msw.d.ts +1 -1
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.d.mts +4 -4
- package/dist/testing/suite.d.ts +4 -4
- package/dist/testing/suite.js +23 -23
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -29,12 +29,29 @@ yarn add @cimplify/sdk
|
|
|
29
29
|
| `@cimplify/sdk/server` | Server Components / Server Actions: `getServerClient()`, `tags.*`, `revalidate*` |
|
|
30
30
|
| `@cimplify/sdk/utils` | Money helpers, formatting, slug helpers |
|
|
31
31
|
| `@cimplify/sdk/advanced` | Lower-level escape hatches |
|
|
32
|
+
| `@cimplify/sdk/lint` | Declarative lint authoring types + the bundled starter rule set |
|
|
33
|
+
| `@cimplify/sdk/lint-rules` | Static, version-matched JSON rules consumed by `cimplify lint` |
|
|
32
34
|
| `@cimplify/sdk/mock` | Programmatic mock for tests / MSW |
|
|
33
35
|
| `@cimplify/sdk/mock/msw` | MSW handlers wrapping the in-process mock |
|
|
34
36
|
| `@cimplify/sdk/testing` | Test harness — zod schemas, `createTestClient`, fixtures, `assertX` helpers |
|
|
35
37
|
| `@cimplify/sdk/testing/suite` | Pre-baked vitest suites: `createBrandSuite`, `createCartFlowSuite`, `createContractSuite` |
|
|
36
38
|
| `@cimplify/sdk/styles.css` | Pre-compiled Tailwind utilities for the React components |
|
|
37
39
|
|
|
40
|
+
`@cimplify/sdk/lint` is intentionally parser-free: it exports serializable rule declarations and six reusable matching primitives. The runner owns AST parsing and reads the installed SDK's `lint-rules` JSON as bounded, validated data—project JavaScript is never loaded by a lint pass. Older SDKs fall back to the trusted rule set bundled with the CLI.
|
|
41
|
+
|
|
42
|
+
### SDK correctness rules
|
|
43
|
+
|
|
44
|
+
Rules are declarations, not AST visitors. The v1 vocabulary is:
|
|
45
|
+
|
|
46
|
+
- `banned-import`
|
|
47
|
+
- `banned-jsx-element`
|
|
48
|
+
- `banned-call-argument`
|
|
49
|
+
- `banned-classname-pattern`
|
|
50
|
+
- `required-result-check`
|
|
51
|
+
- `required-wrapper-call`
|
|
52
|
+
|
|
53
|
+
Add a rule with `defineLintRule(...)`, include it in `starterLintRuleSet`, and add one clean plus one violating fixture under the CLI's `src/lint/__fixtures__` directory. The fixture test runs every rule independently, so a new declaration cannot silently rely on another rule's diagnostic. Flow-sensitive rules that do not fit these primitives belong in a later semantic pass rather than a one-off walker.
|
|
54
|
+
|
|
38
55
|
## Mock storefront API
|
|
39
56
|
|
|
40
57
|
This package ships an embeddable mock storefront API used by tests and local dev:
|
package/dist/advanced.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aL as ELEMENT_TYPES, aM as EVENT_TYPES, aP as ElementEventType, aQ as ElementOptions, aR as ElementType, aZ as ElementsOptions, b5 as FetchQuoteInput, be as FxService, bi as GetProductsOptions, bl as InventoryService, bt as LinkService, bz as LiteService, bG as MESSAGE_TYPES, c6 as OrderQueries, cs as PriceQuote, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cA as QuoteDynamicBuckets, cB as QuoteStatus, cC as QuoteUiMessage, cE as RefreshQuoteInput, cF as RefreshQuoteResult, d5 as SchedulingService, dL as createElements } from './client-
|
|
1
|
+
export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aL as ELEMENT_TYPES, aM as EVENT_TYPES, aP as ElementEventType, aQ as ElementOptions, aR as ElementType, aZ as ElementsOptions, b5 as FetchQuoteInput, be as FxService, bi as GetProductsOptions, bl as InventoryService, bt as LinkService, bz as LiteService, bG as MESSAGE_TYPES, c6 as OrderQueries, cs as PriceQuote, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cA as QuoteDynamicBuckets, cB as QuoteStatus, cC as QuoteUiMessage, cE as RefreshQuoteInput, cF as RefreshQuoteResult, d5 as SchedulingService, dL as createElements } from './client-BwRAAk4y.mjs';
|
|
2
2
|
import './product-CeV8euw4.mjs';
|
|
3
3
|
import './payment-BSzy7sly.mjs';
|
|
4
4
|
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aL as ELEMENT_TYPES, aM as EVENT_TYPES, aP as ElementEventType, aQ as ElementOptions, aR as ElementType, aZ as ElementsOptions, b5 as FetchQuoteInput, be as FxService, bi as GetProductsOptions, bl as InventoryService, bt as LinkService, bz as LiteService, bG as MESSAGE_TYPES, c6 as OrderQueries, cs as PriceQuote, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cA as QuoteDynamicBuckets, cB as QuoteStatus, cC as QuoteUiMessage, cE as RefreshQuoteInput, cF as RefreshQuoteResult, d5 as SchedulingService, dL as createElements } from './client-
|
|
1
|
+
export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aL as ELEMENT_TYPES, aM as EVENT_TYPES, aP as ElementEventType, aQ as ElementOptions, aR as ElementType, aZ as ElementsOptions, b5 as FetchQuoteInput, be as FxService, bi as GetProductsOptions, bl as InventoryService, bt as LinkService, bz as LiteService, bG as MESSAGE_TYPES, c6 as OrderQueries, cs as PriceQuote, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cA as QuoteDynamicBuckets, cB as QuoteStatus, cC as QuoteUiMessage, cE as RefreshQuoteInput, cF as RefreshQuoteResult, d5 as SchedulingService, dL as createElements } from './client-CrPglBBz.js';
|
|
2
2
|
import './product-CeV8euw4.js';
|
|
3
3
|
import './payment-jK8ztICx.js';
|
|
4
4
|
|
package/dist/advanced.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
|
|
4
4
|
require('./chunk-WMEC5JWN.js');
|
|
5
5
|
require('./chunk-NIOUSKQQ.js');
|
|
6
6
|
require('./chunk-OWW5GUSB.js');
|
|
@@ -9,77 +9,77 @@ require('./chunk-OWW5GUSB.js');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "AuthService", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunk3HU5I5VG_js.AuthService; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "BusinessService", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk3HU5I5VG_js.BusinessService; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "CartOperations", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunk3HU5I5VG_js.CartOperations; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "CatalogueQueries", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunk3HU5I5VG_js.CatalogueQueries; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "CheckoutOperations", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunk3HU5I5VG_js.CheckoutService; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "CheckoutService", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk3HU5I5VG_js.CheckoutService; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "CimplifyElement", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunk3HU5I5VG_js.CimplifyElement; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "CimplifyElements", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunk3HU5I5VG_js.CimplifyElements; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "ELEMENT_TYPES", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunk3HU5I5VG_js.ELEMENT_TYPES; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "EVENT_TYPES", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunk3HU5I5VG_js.EVENT_TYPES; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "FxService", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunk3HU5I5VG_js.FxService; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "InventoryService", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunk3HU5I5VG_js.InventoryService; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "LinkService", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunk3HU5I5VG_js.LinkService; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "LiteService", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunk3HU5I5VG_js.LiteService; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "MESSAGE_TYPES", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunk3HU5I5VG_js.MESSAGE_TYPES; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "OrderQueries", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunk3HU5I5VG_js.OrderQueries; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "SchedulingService", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunk3HU5I5VG_js.SchedulingService; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "createElements", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunk3HU5I5VG_js.createElements; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "generateIdempotencyKey", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunk3HU5I5VG_js.generateIdempotencyKey; }
|
|
85
85
|
});
|
package/dist/advanced.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-
|
|
1
|
+
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-Z7M6GAHS.mjs';
|
|
2
2
|
import './chunk-DLW3RWRK.mjs';
|
|
3
3
|
import './chunk-O3YUHLZL.mjs';
|
|
4
4
|
import './chunk-3G6RQLXK.mjs';
|
|
@@ -1219,9 +1219,17 @@ var CheckoutResolver = class {
|
|
|
1219
1219
|
);
|
|
1220
1220
|
}
|
|
1221
1221
|
if (popupError === "PROVIDER_UNAVAILABLE") {
|
|
1222
|
-
return this.fail(
|
|
1222
|
+
return this.fail(
|
|
1223
|
+
"PROVIDER_UNAVAILABLE",
|
|
1224
|
+
"Card payment provider is unavailable.",
|
|
1225
|
+
false
|
|
1226
|
+
);
|
|
1223
1227
|
}
|
|
1224
|
-
return this.fail(
|
|
1228
|
+
return this.fail(
|
|
1229
|
+
"PAYMENT_CANCELLED",
|
|
1230
|
+
"Card payment was cancelled before completion.",
|
|
1231
|
+
true
|
|
1232
|
+
);
|
|
1225
1233
|
}
|
|
1226
1234
|
paymentReference = popupResult.reference || paymentReference;
|
|
1227
1235
|
break;
|
|
@@ -1229,7 +1237,11 @@ var CheckoutResolver = class {
|
|
|
1229
1237
|
case NEXT_ACTION_REDIRECT: {
|
|
1230
1238
|
if (typeof window !== "undefined" && this.returnUrl) {
|
|
1231
1239
|
window.location.assign(action.authorization_url);
|
|
1232
|
-
return this.fail(
|
|
1240
|
+
return this.fail(
|
|
1241
|
+
"REDIRECT_REQUIRED",
|
|
1242
|
+
"Redirecting to complete payment authorization.",
|
|
1243
|
+
true
|
|
1244
|
+
);
|
|
1233
1245
|
}
|
|
1234
1246
|
if (typeof window !== "undefined") {
|
|
1235
1247
|
const popup = window.open(
|
|
@@ -1486,8 +1498,12 @@ var CheckoutResolver = class {
|
|
|
1486
1498
|
apartment: source.apartment || void 0,
|
|
1487
1499
|
city: source.city || "",
|
|
1488
1500
|
region: source.region || "",
|
|
1501
|
+
postal_code: source.postal_code || void 0,
|
|
1502
|
+
country: source.country || void 0,
|
|
1489
1503
|
delivery_instructions: source.delivery_instructions || void 0,
|
|
1490
|
-
phone_for_delivery: source.phone_for_delivery || void 0
|
|
1504
|
+
phone_for_delivery: source.phone_for_delivery || void 0,
|
|
1505
|
+
latitude: source.latitude,
|
|
1506
|
+
longitude: source.longitude
|
|
1491
1507
|
};
|
|
1492
1508
|
}
|
|
1493
1509
|
getEnrollmentMobileMoney() {
|
|
@@ -1861,6 +1877,7 @@ var LinkService = class {
|
|
|
1861
1877
|
);
|
|
1862
1878
|
if (result.ok && result.value.session_token) {
|
|
1863
1879
|
this.client.setAccessToken(result.value.session_token);
|
|
1880
|
+
this.client.activity.refreshIdentity();
|
|
1864
1881
|
this.client.autoClaimChatIdentity();
|
|
1865
1882
|
}
|
|
1866
1883
|
return result;
|
|
@@ -1873,6 +1890,7 @@ var LinkService = class {
|
|
|
1873
1890
|
);
|
|
1874
1891
|
if (result.ok && result.value.session_token) {
|
|
1875
1892
|
this.client.setAccessToken(result.value.session_token);
|
|
1893
|
+
this.client.activity.refreshIdentity();
|
|
1876
1894
|
this.client.autoClaimChatIdentity();
|
|
1877
1895
|
}
|
|
1878
1896
|
return result;
|
|
@@ -2057,6 +2075,7 @@ var AuthService = class {
|
|
|
2057
2075
|
);
|
|
2058
2076
|
if (result.ok && result.value.session_token) {
|
|
2059
2077
|
this.client.setAccessToken(result.value.session_token);
|
|
2078
|
+
this.client.activity.refreshIdentity();
|
|
2060
2079
|
this.client.autoClaimChatIdentity();
|
|
2061
2080
|
}
|
|
2062
2081
|
return result;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createMockApp } from './chunk-
|
|
2
|
-
import { createCimplifyClient } from './chunk-
|
|
1
|
+
import { createMockApp } from './chunk-RQPXLXB2.mjs';
|
|
2
|
+
import { createCimplifyClient } from './chunk-RWR7JF7F.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var cimplifyRegistry = z.registry();
|