@ikas/api-client 0.0.1-canary.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +2 -0
  2. package/dist/api/admin/admin-client.d.ts +10 -0
  3. package/dist/api/admin/admin-client.js +35 -0
  4. package/dist/api/admin/admin-client.js.map +1 -0
  5. package/dist/api/admin/common-gql.d.ts +4 -0
  6. package/dist/api/admin/common-gql.js +14 -0
  7. package/dist/api/admin/common-gql.js.map +1 -0
  8. package/dist/api/admin/generated/index.d.ts +2384 -0
  9. package/dist/api/admin/generated/index.js +319 -0
  10. package/dist/api/admin/generated/index.js.map +1 -0
  11. package/dist/api/admin/index.d.ts +4 -0
  12. package/dist/api/admin/index.js +17 -0
  13. package/dist/api/admin/index.js.map +1 -0
  14. package/dist/api/admin/mutation-gql.d.ts +6 -0
  15. package/dist/api/admin/mutation-gql.js +40 -0
  16. package/dist/api/admin/mutation-gql.js.map +1 -0
  17. package/dist/api/admin/mutation.d.ts +41 -0
  18. package/dist/api/admin/mutation.js +268 -0
  19. package/dist/api/admin/mutation.js.map +1 -0
  20. package/dist/api/admin/query-gql.d.ts +6 -0
  21. package/dist/api/admin/query-gql.js +39 -0
  22. package/dist/api/admin/query-gql.js.map +1 -0
  23. package/dist/api/admin/query.d.ts +38 -0
  24. package/dist/api/admin/query.js +220 -0
  25. package/dist/api/admin/query.js.map +1 -0
  26. package/dist/api/admin/rest.d.ts +21 -0
  27. package/dist/api/admin/rest.js +75 -0
  28. package/dist/api/admin/rest.js.map +1 -0
  29. package/dist/api/base.d.ts +47 -0
  30. package/dist/api/base.js +182 -0
  31. package/dist/api/base.js.map +1 -0
  32. package/dist/api/index.d.ts +2 -0
  33. package/dist/api/index.js +15 -0
  34. package/dist/api/index.js.map +1 -0
  35. package/dist/api/oauth/index.d.ts +12 -0
  36. package/dist/api/oauth/index.js +111 -0
  37. package/dist/api/oauth/index.js.map +1 -0
  38. package/dist/api/oauth/models.d.ts +40 -0
  39. package/dist/api/oauth/models.js +23 -0
  40. package/dist/api/oauth/models.js.map +1 -0
  41. package/dist/globals/constants.d.ts +13 -0
  42. package/dist/globals/constants.js +15 -0
  43. package/dist/globals/constants.js.map +1 -0
  44. package/dist/globals/index.d.ts +1 -0
  45. package/dist/globals/index.js +14 -0
  46. package/dist/globals/index.js.map +1 -0
  47. package/dist/helpers/index.d.ts +1 -0
  48. package/dist/helpers/index.js +14 -0
  49. package/dist/helpers/index.js.map +1 -0
  50. package/dist/helpers/webhook-validate.d.ts +1 -0
  51. package/dist/helpers/webhook-validate.js +67 -0
  52. package/dist/helpers/webhook-validate.js.map +1 -0
  53. package/dist/index.d.ts +21 -0
  54. package/dist/index.js +33 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/models/base.d.ts +7 -0
  57. package/dist/models/base.js +3 -0
  58. package/dist/models/base.js.map +1 -0
  59. package/dist/models/index.d.ts +1 -0
  60. package/dist/models/index.js +14 -0
  61. package/dist/models/index.js.map +1 -0
  62. package/dist/models/webhook/index.d.ts +1 -0
  63. package/dist/models/webhook/index.js +14 -0
  64. package/dist/models/webhook/index.js.map +1 -0
  65. package/dist/models/webhook/models.d.ts +68 -0
  66. package/dist/models/webhook/models.js +19 -0
  67. package/dist/models/webhook/models.js.map +1 -0
  68. package/package.json +56 -0
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./webhook-validate"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC"}
@@ -0,0 +1 @@
1
+ export declare const webhookValidate: (clientSecret: string) => (req: any, res: any, next: () => any) => Promise<void>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.webhookValidate = void 0;
43
+ var crypto_1 = __importDefault(require("crypto"));
44
+ var webhookValidate = function (clientSecret) { return function (req, res, next) { return __awaiter(void 0, void 0, void 0, function () {
45
+ var data, generatedHash;
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0:
49
+ data = req.body;
50
+ generatedHash = crypto_1.default
51
+ .createHmac('sha256', clientSecret || '')
52
+ .update(data.data, 'utf8')
53
+ .digest('hex');
54
+ if (!(generatedHash === data.signature)) return [3 /*break*/, 2];
55
+ return [4 /*yield*/, next()];
56
+ case 1:
57
+ _a.sent();
58
+ return [3 /*break*/, 3];
59
+ case 2:
60
+ res.status(401).send({ message: 'invalid signature', statusCode: 401 });
61
+ _a.label = 3;
62
+ case 3: return [2 /*return*/];
63
+ }
64
+ });
65
+ }); }; };
66
+ exports.webhookValidate = webhookValidate;
67
+ //# sourceMappingURL=webhook-validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-validate.js","sourceRoot":"","sources":["../../src/helpers/webhook-validate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAA4B;AAErB,IAAM,eAAe,GAAG,UAAC,YAAoB,IAAK,OAAA,UAAO,GAAQ,EAAE,GAAQ,EAAE,IAAe;;;;;gBAC3F,IAAI,GAAgB,GAAG,CAAC,IAAI,CAAC;gBAE7B,aAAa,GAAG,gBAAM;qBACzB,UAAU,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC;qBACxC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;qBACzB,MAAM,CAAC,KAAK,CAAC,CAAC;qBAEb,CAAA,aAAa,KAAK,IAAI,CAAC,SAAS,CAAA,EAAhC,wBAAgC;gBAClC,qBAAM,IAAI,EAAE,EAAA;;gBAAZ,SAAY,CAAC;;;gBAEb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;;;;;KAE3E,EAbwD,CAaxD,CAAC;AAbW,QAAA,eAAe,mBAa1B"}
@@ -0,0 +1,21 @@
1
+ import { ikasAdminGraphQLAPIClient } from './api';
2
+ import { IkasConfig } from './globals';
3
+ import { OnCheckTokenCallback } from './api/base';
4
+ export * from './api';
5
+ export * from './globals';
6
+ export * from './helpers';
7
+ export * from './models';
8
+ declare type AppProps<TokenData> = {
9
+ clientId: string;
10
+ clientSecret: string;
11
+ accessToken: string;
12
+ apiVersion?: 'v1';
13
+ tokenData?: TokenData;
14
+ onCheckToken?: OnCheckTokenCallback<TokenData>;
15
+ [p: string]: any;
16
+ };
17
+ export declare class ikas<TokenData> {
18
+ adminApi: ikasAdminGraphQLAPIClient<TokenData>;
19
+ config: IkasConfig;
20
+ constructor(props: AppProps<TokenData>);
21
+ }
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.ikas = void 0;
14
+ var api_1 = require("./api");
15
+ var globals_1 = require("./globals");
16
+ __exportStar(require("./api"), exports);
17
+ __exportStar(require("./globals"), exports);
18
+ __exportStar(require("./helpers"), exports);
19
+ __exportStar(require("./models"), exports);
20
+ var ikas = /** @class */ (function () {
21
+ function ikas(props) {
22
+ this.config = new globals_1.IkasConfig(props);
23
+ this.adminApi = new api_1.ikasAdminGraphQLAPIClient({
24
+ accessToken: props.accessToken,
25
+ graphApiUrl: this.config.adminApiUrl,
26
+ tokenData: props.tokenData,
27
+ onCheckToken: props.onCheckToken,
28
+ });
29
+ }
30
+ return ikas;
31
+ }());
32
+ exports.ikas = ikas;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6BAAkD;AAClD,qCAAuC;AAGvC,wCAAsB;AACtB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AAYzB;IAIE,cAAY,KAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAU,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,CAAC,QAAQ,GAAG,IAAI,+BAAyB,CAAC;YAC5C,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,CAAC;IACL,CAAC;IACH,WAAC;AAAD,CAAC,AAdD,IAcC;AAdY,oBAAI"}
@@ -0,0 +1,7 @@
1
+ export interface IBaseModelWithIdAndDates {
2
+ id: string;
3
+ createdAt?: Date | null;
4
+ updatedAt?: Date | null;
5
+ merchantId?: string | null;
6
+ deleted?: boolean | null;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/models/base.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './webhook';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./webhook"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B"}
@@ -0,0 +1 @@
1
+ export * from './models';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./models"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/webhook/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB"}
@@ -0,0 +1,68 @@
1
+ import { Category, Customer, MerchantAppPaymentStatusEnum, MerchantAppPaymentTypeEnum, MerchantAppSubscription, MerchantLicenceStatusEnum, Order, Product, ProductAttribute, ProductAttributeOption, ProductAttributeValue, ProductBrand, ProductStockLocation, ProductTag, ProductVariantType, Variant, VariantType } from '../../api';
2
+ export declare enum WebhookScope {
3
+ ORDER_CREATED = "store/order/created",
4
+ ORDER_UPDATED = "store/order/updated",
5
+ PRODUCT_CREATED = "store/product/created",
6
+ PRODUCT_UPDATED = "store/product/updated",
7
+ CUSTOMER_CREATED = "store/customer/created",
8
+ CUSTOMER_UPDATED = "store/customer/updated",
9
+ CUSTOMER_FAVORITE_PRODUCTS_CREATED = "store/customerFavoriteProducts/created",
10
+ CUSTOMER_FAVORITE_PRODUCTS_UPDATED = "store/customerFavoriteProducts/updated",
11
+ STOCK_CREATED = "store/stock/created",
12
+ STOCK_UPDATED = "store/stock/updated",
13
+ APP_DELETED = "store/app/deleted",
14
+ APP_PAYMENT = "store/app/payment"
15
+ }
16
+ export interface IkasWebhook {
17
+ id: string;
18
+ createdAt: string;
19
+ scope: string;
20
+ merchantId: string;
21
+ data: string;
22
+ signature: string;
23
+ authorizedAppId: string;
24
+ }
25
+ interface IWebhookProductAttributeValue extends ProductAttributeValue {
26
+ productAttribute?: ProductAttribute | null;
27
+ productAttributeOption?: ProductAttributeOption | null;
28
+ }
29
+ interface IWebhookProductVariantType extends ProductVariantType {
30
+ variantType: VariantType;
31
+ }
32
+ interface IWebhookVariant extends Variant {
33
+ attributes?: IWebhookProductAttributeValue[] | null;
34
+ }
35
+ export interface IWebhookProduct extends Product {
36
+ productVariantTypes?: IWebhookProductVariantType[] | null;
37
+ variants: IWebhookVariant[];
38
+ attributes?: IWebhookProductAttributeValue[] | null;
39
+ tags?: ProductTag[] | null;
40
+ brand?: ProductBrand | null;
41
+ categories?: Category[] | null;
42
+ }
43
+ export interface IWebhookOrder extends Order {
44
+ }
45
+ export interface IWebhookCustomer extends Customer {
46
+ }
47
+ export interface IWebhookStock extends ProductStockLocation {
48
+ }
49
+ export declare type IWebhookStoreAppPaymentData = {
50
+ merchantAppPayment: {
51
+ _id: string;
52
+ appPaymentKey: string;
53
+ name: string;
54
+ type: MerchantAppPaymentTypeEnum;
55
+ status: MerchantAppPaymentStatusEnum;
56
+ paymentDate?: Date | null;
57
+ error?: string | null;
58
+ };
59
+ merchantLicence: {
60
+ licenceActivationDate?: Date | null;
61
+ fromDate?: Date | null;
62
+ toDate?: Date | null;
63
+ status: MerchantLicenceStatusEnum;
64
+ statusUpdatedAt: Date | null;
65
+ appSubscription?: MerchantAppSubscription[] | null;
66
+ };
67
+ };
68
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookScope = void 0;
4
+ var WebhookScope;
5
+ (function (WebhookScope) {
6
+ WebhookScope["ORDER_CREATED"] = "store/order/created";
7
+ WebhookScope["ORDER_UPDATED"] = "store/order/updated";
8
+ WebhookScope["PRODUCT_CREATED"] = "store/product/created";
9
+ WebhookScope["PRODUCT_UPDATED"] = "store/product/updated";
10
+ WebhookScope["CUSTOMER_CREATED"] = "store/customer/created";
11
+ WebhookScope["CUSTOMER_UPDATED"] = "store/customer/updated";
12
+ WebhookScope["CUSTOMER_FAVORITE_PRODUCTS_CREATED"] = "store/customerFavoriteProducts/created";
13
+ WebhookScope["CUSTOMER_FAVORITE_PRODUCTS_UPDATED"] = "store/customerFavoriteProducts/updated";
14
+ WebhookScope["STOCK_CREATED"] = "store/stock/created";
15
+ WebhookScope["STOCK_UPDATED"] = "store/stock/updated";
16
+ WebhookScope["APP_DELETED"] = "store/app/deleted";
17
+ WebhookScope["APP_PAYMENT"] = "store/app/payment";
18
+ })(WebhookScope = exports.WebhookScope || (exports.WebhookScope = {}));
19
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/webhook/models.ts"],"names":[],"mappings":";;;AAoBA,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB,qDAAqC,CAAA;IACrC,qDAAqC,CAAA;IACrC,yDAAyC,CAAA;IACzC,yDAAyC,CAAA;IACzC,2DAA2C,CAAA;IAC3C,2DAA2C,CAAA;IAC3C,6FAA6E,CAAA;IAC7E,6FAA6E,CAAA;IAC7E,qDAAqC,CAAA;IACrC,qDAAqC,CAAA;IACrC,iDAAiC,CAAA;IACjC,iDAAiC,CAAA;AACnC,CAAC,EAbW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAavB"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@ikas/api-client",
3
+ "version": "0.0.1-canary.11",
4
+ "description": "ikas public node api client for store apps and private apps",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "author": "ikas",
11
+ "license": "MIT",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "keywords": [
16
+ "ikas",
17
+ "graphql",
18
+ "Public API"
19
+ ],
20
+ "dependencies": {
21
+ "axios": "^0.24.0",
22
+ "graphql": "^16.0.1",
23
+ "graphql-request": "^3.6.1",
24
+ "qs": "^6.10.1"
25
+ },
26
+ "devDependencies": {
27
+ "@graphql-codegen/cli": "^2.3.0",
28
+ "@graphql-codegen/typescript": "^2.4.1",
29
+ "@types/qs": "^6.9.7",
30
+ "git-branch-is": "^4.0.0",
31
+ "husky": "4.3.8",
32
+ "prettier": "^2.4.1",
33
+ "typescript": "^4.5.2"
34
+ },
35
+ "scripts": {
36
+ "build": "npx tsc",
37
+ "generate:admin": "graphql-codegen --config codegen/admin.yml",
38
+ "version:patch": "yarn build && npm --no-git-tag-version version patch && git add .",
39
+ "version:canary": "yarn build && npm --no-git-tag-version version prerelease --preid=canary && git add .",
40
+ "publish:patch": "yarn version:patch && npm publish --access public --tag latest",
41
+ "publish:canary": "yarn version:canary && npm publish --access restricted --tag canary"
42
+ },
43
+ "husky": {
44
+ "hooks": {
45
+ "pre-commit": "git-branch-is main && yarn version:patch || (git-branch-is development && yarn version:canary)"
46
+ }
47
+ },
48
+ "prettier": {
49
+ "semi": true,
50
+ "trailingComma": "all",
51
+ "singleQuote": true,
52
+ "printWidth": 150,
53
+ "tabWidth": 2,
54
+ "bracketSpacing": true
55
+ }
56
+ }