sanity-plugin-shopify-assets 1.2.3 → 2.0.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Sanity.io
3
+ Copyright (c) 2026 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -69,14 +69,14 @@ defineField({
69
69
  "alt": "",
70
70
  "width": 3169,
71
71
  "height": 3169,
72
- "duration": 60 // video only
72
+ "duration": 60, // video only
73
73
  },
74
74
  "preview": {
75
75
  "url": "https://cdn.shopify.com/s/files/1/0555/4906/7569/files/Green_1.jpg?v=1665668073",
76
76
  "width": 3169,
77
- "height": 3169
77
+ "height": 3169,
78
78
  },
79
- "filename": "Green_1.jpg"
79
+ "filename": "Green_1.jpg",
80
80
  }
81
81
  ```
82
82
 
package/dist/index.d.ts CHANGED
@@ -1,73 +1,61 @@
1
- import type {ObjectSchemaType} from 'sanity'
2
- import {Plugin as Plugin_2} from 'sanity'
3
-
4
- export declare interface Asset extends ShopifyFile {
5
- _type?: string
6
- _key?: string
7
- filename?: string
8
- }
9
-
10
- export declare interface AssetMeta {
11
- alt?: string
12
- duration?: number
13
- fileSize?: number
14
- height?: number
15
- width?: number
16
- }
17
-
18
- export declare interface AssetPreviewImage {
19
- height: number
20
- url: string
21
- width: number
22
- }
23
-
24
- export declare interface ObjectSchemaWithOptions extends ObjectSchemaType {
25
- options: {
26
- shopifyDomain: string
27
- }
28
- }
29
-
30
- export declare interface PageInfo {
31
- hasNextPage: boolean
32
- cursor: string
33
- }
34
-
35
- export declare interface PluginConfig {
1
+ import { ObjectDefinition, ObjectSchemaType } from "sanity";
2
+ interface PluginConfig {
36
3
  /**
37
4
  * Your *.myshopify.com domain. Do not include https:// or any path.
38
5
  */
39
- shopifyDomain: string
40
- }
41
-
42
- declare type PossibleFileTypes = 'file' | 'image' | 'video'
43
-
44
- export declare interface ShopifyAPIResponse {
45
- pageInfo: PageInfo
46
- assets: ShopifyFile[]
6
+ shopifyDomain: string;
47
7
  }
48
-
49
- export declare const shopifyAssets: Plugin_2<PluginConfig>
50
-
51
- export declare interface ShopifyFile {
52
- meta: AssetMeta
53
- preview: AssetPreviewImage
54
- id: string
55
- type: PossibleFileTypes
56
- url: string
8
+ interface ObjectSchemaWithOptions extends ObjectSchemaType {
9
+ options: {
10
+ shopifyDomain: string;
11
+ };
12
+ }
13
+ type PossibleFileTypes = 'file' | 'image' | 'video';
14
+ interface AssetPreviewImage {
15
+ height: number;
16
+ url: string;
17
+ width: number;
18
+ }
19
+ interface AssetMeta {
20
+ alt?: string;
21
+ duration?: number;
22
+ fileSize?: number;
23
+ height?: number;
24
+ width?: number;
25
+ }
26
+ interface ShopifyFile {
27
+ meta: AssetMeta;
28
+ preview: AssetPreviewImage;
29
+ id: string;
30
+ type: PossibleFileTypes;
31
+ url: string;
32
+ }
33
+ interface Asset extends ShopifyFile {
34
+ _type?: string;
35
+ _key?: string;
36
+ filename?: string;
37
+ }
38
+ interface PageInfo {
39
+ hasNextPage: boolean;
40
+ cursor: string;
41
+ }
42
+ interface ShopifyAPIResponse {
43
+ pageInfo: PageInfo;
44
+ assets: ShopifyFile[];
57
45
  }
58
-
59
- export {}
60
-
61
46
  declare module 'sanity' {
62
47
  namespace Schema {
63
48
  type ShopifyAssetTypeDef = Omit<ObjectDefinition, 'type' | 'fields'> & {
64
- type: 'shopify.asset'
65
- options: {
66
- shopifyDomain: string
67
- }
68
- }
49
+ type: 'shopify.asset';
50
+ options?: {
51
+ shopifyDomain?: string;
52
+ };
53
+ };
69
54
  interface IntrinsicTypeDefinition {
70
- 'shopify.asset': ShopifyAssetTypeDef
55
+ 'shopify.asset': ShopifyAssetTypeDef;
71
56
  }
72
57
  }
73
58
  }
59
+ declare const shopifyAssets: import("sanity").Plugin<PluginConfig>;
60
+ export { Asset, AssetMeta, AssetPreviewImage, ObjectSchemaWithOptions, PageInfo, PluginConfig, ShopifyAPIResponse, ShopifyFile, shopifyAssets };
61
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";UAEiB,YAAA;EAAA;;;EAIf,aAAa;AAAA;AAAA,UAGE,uBAAA,SAAgC,gBAAgB;EAC/D,OAAA;IACE,aAAA;EAAA;AAAA;AAAA,KAIC,iBAAA;AAAA,UAEY,iBAAA;EACf,MAAA;EACA,GAAA;EACA,KAAA;AAAA;AAAA,UAGe,SAAA;EACf,GAAA;EACA,QAAA;EACA,QAAA;EACA,MAAA;EACA,KAAA;AAAA;AAAA,UAGe,WAAA;EACf,IAAA,EAAM,SAAA;EACN,OAAA,EAAS,iBAAA;EACT,EAAA;EACA,IAAA,EAAM,iBAAA;EACN,GAAA;AAAA;AAAA,UAGe,KAAA,SAAc,WAAW;EACxC,KAAA;EACA,IAAA;EACA,QAAA;AAAA;AAAA,UAGe,QAAA;EACf,WAAA;EACA,MAAM;AAAA;AAAA,UAGS,kBAAA;EACf,QAAA,EAAU,QAAA;EACV,MAAA,EAAQ,WAAW;AAAA;AAAA;EAAA,UCzCF,MAAA;IAAA,KAGH,mBAAA,GAAsB,IAAA,CAAK,gBAAA;MACrC,IAAA;MACA,OAAA;QACE,aAAA;MAAA;IAAA;IAAA,UAIa,uBAAA;MACf,eAAA,EAAiB,mBAAA;IAAA;EAAA;AAAA;AAAA,cAKV,aAAA,mBAAa,MAAA,CAAA,YAAA"}