feed-common 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.1.1](https://github.com/advertikon/package-maxify-feed-common/compare/v1.1.0...v1.1.1) (2024-02-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix shopify types ([0482e82](https://github.com/advertikon/package-maxify-feed-common/commit/0482e82a5b02eb7cfa4f7b16abce1fb95e4210c5))
7
+
1
8
  # [1.1.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.0.3...v1.1.0) (2024-02-11)
2
9
 
3
10
 
@@ -1,17 +1,17 @@
1
- import { Product } from '@shopify/shopify-api/rest/admin/2023-07/product';
2
- import { Variant } from '@shopify/shopify-api/rest/admin/2023-07/variant';
3
- import { Shop } from '@shopify/shopify-api/rest/admin/2023-07/shop';
4
- import { Webhook } from '@shopify/shopify-api/rest/admin/2023-07/webhook';
5
- import { CustomCollection } from '@shopify/shopify-api/rest/admin/2023-07/custom_collection';
6
- import { SmartCollection } from '@shopify/shopify-api/rest/admin/2023-07/smart_collection';
7
- import { RecurringApplicationCharge } from '@shopify/shopify-api/rest/admin/2023-07/recurring_application_charge';
8
- type ShopifyCollection = CustomCollection | SmartCollection;
9
- type ShopifyProductVariant = Variant & {
1
+ import { RestResources } from '@shopify/shopify-api/rest/admin/2023-07';
2
+ type GetInstanceType<T extends keyof RestResources> = InstanceType<RestResources[T]>;
3
+ type ShopifyRecurringCharge = GetInstanceType<'RecurringApplicationCharge'>;
4
+ type ShopifyShop = GetInstanceType<'Shop'>;
5
+ type ShopifyWebhook = GetInstanceType<'Webhook'>;
6
+ type ShopifyCustomCollection = GetInstanceType<'CustomCollection'>;
7
+ type ShopifySmartCollection = GetInstanceType<'SmartCollection'>;
8
+ type ShopifyCollection = ShopifyCustomCollection | ShopifySmartCollection;
9
+ type ShopifyProductVariant = GetInstanceType<'Variant'> & {
10
10
  images: {
11
11
  variant_ids?: number[];
12
12
  }[];
13
13
  };
14
- type ShopifyProduct = Product & {
14
+ type ShopifyProduct = GetInstanceType<'Product'> & {
15
15
  variants: ShopifyProductVariant[];
16
16
  };
17
17
  export type WebhookHeader = {
@@ -32,5 +32,5 @@ export type WebhookHeader = {
32
32
  'x-shopify-triggered-at': string;
33
33
  'x-shopify-webhook-id': string;
34
34
  };
35
- export { Shop as ShopifyShop, ShopifyProduct, Webhook as ShopifyWebhook, CustomCollection as ShopifyCustomCollection, SmartCollection as ShopifySmartCollection, ShopifyCollection, RecurringApplicationCharge as ShopifyRecurringCharge, };
35
+ export { ShopifyShop, ShopifyProduct, ShopifyWebhook, ShopifyCustomCollection, ShopifySmartCollection, ShopifyCollection, ShopifyRecurringCharge, };
36
36
  //# sourceMappingURL=shopify.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shopify.types.d.ts","sourceRoot":"","sources":["../../src/types/shopify.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sEAAsE,CAAC;AAElH,KAAK,iBAAiB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAC5D,KAAK,qBAAqB,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC;AAChF,KAAK,cAAc,GAAG,OAAO,GAAG;IAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,aAAa,GAA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AACjE,KAAK,iBAAiB,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;AAC1E,KAAK,qBAAqB,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IACxD,MAAM,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CACtC,CAAC;AACF,KAAK,cAAc,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IACjD,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,MAAM,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,CAAC"}
@@ -1,7 +1,2 @@
1
- import { Shop } from '@shopify/shopify-api/rest/admin/2023-07/shop';
2
- import { Webhook } from '@shopify/shopify-api/rest/admin/2023-07/webhook';
3
- import { CustomCollection } from '@shopify/shopify-api/rest/admin/2023-07/custom_collection';
4
- import { SmartCollection } from '@shopify/shopify-api/rest/admin/2023-07/smart_collection';
5
- import { RecurringApplicationCharge } from '@shopify/shopify-api/rest/admin/2023-07/recurring_application_charge';
6
- export { Shop as ShopifyShop, Webhook as ShopifyWebhook, CustomCollection as ShopifyCustomCollection, SmartCollection as ShopifySmartCollection, RecurringApplicationCharge as ShopifyRecurringCharge, };
1
+ export {};
7
2
  //# sourceMappingURL=shopify.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shopify.types.js","sourceRoot":"","sources":["../../src/types/shopify.types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sEAAsE,CAAC;AAyBlH,OAAO,EACH,IAAI,IAAI,WAAW,EAEnB,OAAO,IAAI,cAAc,EACzB,gBAAgB,IAAI,uBAAuB,EAC3C,eAAe,IAAI,sBAAsB,EAEzC,0BAA0B,IAAI,sBAAsB,GACvD,CAAC"}
1
+ {"version":3,"file":"shopify.types.js","sourceRoot":"","sources":["../../src/types/shopify.types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feed-common",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Maxify feed common library",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,40 +1,45 @@
1
- import { Product } from '@shopify/shopify-api/rest/admin/2023-07/product';
2
- import { Variant } from '@shopify/shopify-api/rest/admin/2023-07/variant';
3
- import { Shop } from '@shopify/shopify-api/rest/admin/2023-07/shop';
4
- import { Webhook } from '@shopify/shopify-api/rest/admin/2023-07/webhook';
5
- import { CustomCollection } from '@shopify/shopify-api/rest/admin/2023-07/custom_collection';
6
- import { SmartCollection } from '@shopify/shopify-api/rest/admin/2023-07/smart_collection';
7
- import { RecurringApplicationCharge } from '@shopify/shopify-api/rest/admin/2023-07/recurring_application_charge';
1
+ import { RestResources } from '@shopify/shopify-api/rest/admin/2023-07';
8
2
 
9
- type ShopifyCollection = CustomCollection | SmartCollection;
10
- type ShopifyProductVariant = Variant & { images: { variant_ids?: number[] }[] };
11
- type ShopifyProduct = Product & { variants: ShopifyProductVariant[] };
3
+ type GetInstanceType<T extends keyof RestResources> = InstanceType<RestResources[T]>;
4
+
5
+ type ShopifyRecurringCharge = GetInstanceType<'RecurringApplicationCharge'>;
6
+ type ShopifyShop = GetInstanceType<'Shop'>;
7
+ type ShopifyWebhook = GetInstanceType<'Webhook'>;
8
+ type ShopifyCustomCollection = GetInstanceType<'CustomCollection'>;
9
+ type ShopifySmartCollection = GetInstanceType<'SmartCollection'>;
10
+ type ShopifyCollection = ShopifyCustomCollection | ShopifySmartCollection;
11
+ type ShopifyProductVariant = GetInstanceType<'Variant'> & {
12
+ images: { variant_ids?: number[] }[];
13
+ };
14
+ type ShopifyProduct = GetInstanceType<'Product'> & {
15
+ variants: ShopifyProductVariant[];
16
+ };
12
17
 
13
18
  export type WebhookHeader = {
14
- host: string;
15
- 'user-agent': string;
16
- 'content-length': string;
17
- accept: string;
18
- 'accept-encoding': string;
19
- 'content-type': string;
20
- 'x-forwarded-for': string;
21
- 'x-forwarded-host': string;
22
- 'x-forwarded-proto': string;
23
- 'x-shopify-api-version': string;
24
- 'x-shopify-hmac-sha256': string;
25
- 'x-shopify-product-id': string;
26
- 'x-shopify-shop-domain': string;
27
- 'x-shopify-topic': string;
28
- 'x-shopify-triggered-at': string;
29
- 'x-shopify-webhook-id': string;
19
+ host: string;
20
+ 'user-agent': string;
21
+ 'content-length': string;
22
+ accept: string;
23
+ 'accept-encoding': string;
24
+ 'content-type': string;
25
+ 'x-forwarded-for': string;
26
+ 'x-forwarded-host': string;
27
+ 'x-forwarded-proto': string;
28
+ 'x-shopify-api-version': string;
29
+ 'x-shopify-hmac-sha256': string;
30
+ 'x-shopify-product-id': string;
31
+ 'x-shopify-shop-domain': string;
32
+ 'x-shopify-topic': string;
33
+ 'x-shopify-triggered-at': string;
34
+ 'x-shopify-webhook-id': string;
30
35
  };
31
36
 
32
37
  export {
33
- Shop as ShopifyShop,
34
- ShopifyProduct,
35
- Webhook as ShopifyWebhook,
36
- CustomCollection as ShopifyCustomCollection,
37
- SmartCollection as ShopifySmartCollection,
38
- ShopifyCollection,
39
- RecurringApplicationCharge as ShopifyRecurringCharge,
38
+ ShopifyShop,
39
+ ShopifyProduct,
40
+ ShopifyWebhook,
41
+ ShopifyCustomCollection,
42
+ ShopifySmartCollection,
43
+ ShopifyCollection,
44
+ ShopifyRecurringCharge,
40
45
  };