From 85567c12335b31263d5a4faa405de8029d74f20b Mon Sep 17 00:00:00 2001 From: Mridul Sharma Date: Fri, 31 Oct 2025 18:11:19 +0530 Subject: [PATCH] fix: fixed npm ci issue for publish action --- .gitignore | 2 +- .talismanrc | 2 + src/setup/index.d.ts | 112 +++++++++++++++++++++++++++++++++++++++++++ tsconfig.json | 1 + 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/setup/index.d.ts diff --git a/.gitignore b/.gitignore index 840d755..2c00ba3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ out/ *.d.ts.map *.js.map *.d.ts -!src/types/setup-index-module.d.ts +!src/setup/index.d.ts # ESLint cache .eslintcache diff --git a/.talismanrc b/.talismanrc index 2dbfc0b..6c03a50 100644 --- a/.talismanrc +++ b/.talismanrc @@ -22,4 +22,6 @@ fileignoreconfig: checksum: e71ec7cc7cfc72cd7f87ce90c3538914ce571788872c00a009a3221dd5b876ef - filename: src/setup/__tests__/index.test.js checksum: bfe9d72867ce3255060c5b494460c04f89fba2f2f513f6fdaf053624d9742119 +- filename: src/setup/index.d.ts + checksum: 9369a9bb34c12addfdae51d7d7a6bffdf7a3d8dd93635b3de7950db04dbf958b version: "1.0" \ No newline at end of file diff --git a/src/setup/index.d.ts b/src/setup/index.d.ts new file mode 100644 index 0000000..cb85a1d --- /dev/null +++ b/src/setup/index.d.ts @@ -0,0 +1,112 @@ +// TypeScript declarations for setup/index.js + +export interface ContentType { + uid: string; + schema: FieldSchema[]; + [key: string]: unknown; +} + +export interface FieldSchema { + uid: string; + data_type: string; + multiple?: boolean; + blocks?: unknown[]; + reference_to?: string; + [key: string]: unknown; +} + +export interface Entry { + uid: string; + _content_type_uid: string; + _metadata?: { + uid: string; + [key: string]: unknown; + }; + [key: string]: unknown; +} + +export interface Asset { + uid: string; + url: string; + filename: string; + _metadata?: { + extensions?: Record; + [key: string]: unknown; + }; + [key: string]: unknown; +} + +export interface MetaobjectEntries { + [type: string]: { + [path: string]: { + id?: string; + _field_type?: string; + values?: unknown[]; + toJSON(): unknown; + [key: string]: unknown; + }; + }; +} + +export interface UpdatedProductMetafields { + [key: string]: { + value: unknown; + toJSON(): unknown; + system?: unknown; + }; +} + +export interface UpdatedMetaobject { + currentMetaobjects: unknown; + dataCSLPMapping: Record; +} + +export interface ShopifyFieldsOptions { + [key: string]: unknown; +} + +export interface KeyBasedContentType { + [fieldUid: string]: FieldSchema; +} + +export declare function fetchData( + ctUID: string, + entryUID: string, + hash: string, + locale: string +): Promise; + +export declare function createMetaobjectEntries( + contentType: ContentType | FieldSchema, + entries: Entry[], + type: string, + path: string, + entryMetaObject: MetaobjectEntries, + dataCSLPMapping: Record, + extraData: unknown +): Promise; + +export declare function getUpdatedProductMetafields( + currentMetafields: unknown, + keyBasedCt: KeyBasedContentType, + entry: Entry, + options: { + ctUid: string; + entryUid: string; + hash: string; + } +): Promise; + +export declare function getUpdatedMetaobject( + currentMetaobjects: unknown, + keyBasedCt: KeyBasedContentType, + entry: Entry, + options: { + ctUid: string; + hash: string; + } +): Promise; + +export declare function createContentTypeKeyBased( + contentType: FieldSchema[] +): KeyBasedContentType; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 2d8b529..23a7ac7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "rootDir": "./src", "strict": true, "esModuleInterop": true, + "allowJs": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "declaration": true,