commerce-kit 0.6.1-experimental.1 → 0.6.1-experimental.10
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/dist/api-types.d.ts +5206 -0
- package/dist/api-types.js +2 -0
- package/dist/api-types.js.map +1 -0
- package/dist/chunk-PNKB6P4V.js +1 -0
- package/dist/chunk-PNKB6P4V.js.map +1 -0
- package/dist/index.d.ts +7 -18
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-PNKB6P4V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type APIProductsBrowseResult = { data: (({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: undefined; price: string; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: string | null; })[]; }))[]; meta: { count: number; }; };
|
|
4
|
-
|
|
5
|
-
type APIProductsBrowseParams = { limit: number; offset?: number | undefined; category?: string | undefined; query?: string | undefined; active?: boolean | undefined; excludeBundles?: boolean | undefined; orderBy?: "name" | "createdAt" | "price" | undefined; orderDirection?: "asc" | "desc" | undefined; };
|
|
6
|
-
|
|
7
|
-
type APIProductGetByIdResult = ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variantsTypes: { id: string; type: "string" | "color"; label: string; variantValues: { id: string; value: string; position: number | null; colorValue: string | null; }[]; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; position: number | null; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: undefined; })[]; }) | ({ id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; category: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; storeId: string | null; position: string; active: boolean; parentId: string | null; } | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; bundleProducts: { createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; variant: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; product: { id: string; name: string; slug: string; images: string[]; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }[]; }; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }; }[]; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; variantsTypes: { id: string; type: "string" | "color"; label: string; variantValues: { id: string; value: string; position: number | null; colorValue: string | null; }[]; }[]; variants: { id: string; createdAt: string; updatedAt: string; storeId: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; position: number | null; colorValue: string | null; variantType: { id: string; type: "string" | "color"; label: string; }; }; }[]; }[]; } & { variants: ({ price: string; } & { prePromotionPrice: string | null; })[]; });
|
|
8
|
-
|
|
9
|
-
type APIProductGetByIdParams = { idOrSlug: string; };
|
|
10
|
-
|
|
11
|
-
type APICartGetResult = { lineItems: { productVariant: ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; price: string; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: string | null; }); id: string; createdAt: string; updatedAt: string; cartId: string; quantity: number; productVariantId: string; subscriptionId: string | null; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; }[]; id: string; createdAt: string; updatedAt: string; storeId: string; addonData: Record<string, unknown> | null | undefined; couponId: string | null; customerId: string | null; stripePaymentIntentId: string | null; checkoutSessionId: string | null; shippingId: string | null; shippingAddressId: string | null; billingAddressId: string | null; shipping: { id: string; name: string; createdAt: string; updatedAt: string; type: "courier" | "parcel" | "pickup_point" | "in_store"; description: string | null; storeId: string; price: string; minShippingTime: number | null; maxShippingTime: number | null; position: number | null; addonId: string | null; addonData: unknown; countries: string[] | null; shippingAddon: { id: string; name: string; createdAt: string; updatedAt: string; type: "shipping" | "analytics" | "products" | "invoicing"; storeId: string; } | null; shippingTaxRate: { createdAt: string; updatedAt: string; shippingId: string; taxRateId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; } | null; coupon: { type: "fixed" | "percentage"; value: string; code: string; startDate: string | null; endDate: string | null; } | null; billingAddress: { id: string; name: string | null; createdAt: string; updatedAt: string; type: "shipping" | "billing" | "merchant"; company: string | null; city: string | null; country: string | null; line1: string | null; line2: string | null; postalCode: string | null; state: string | null; phone: string | null; taxId: string | null; } | null; shippingAddress: { id: string; name: string | null; createdAt: string; updatedAt: string; type: "shipping" | "billing" | "merchant"; company: string | null; city: string | null; country: string | null; line1: string | null; line2: string | null; postalCode: string | null; state: string | null; phone: string | null; taxId: string | null; } | null; customer: { id: string; email: string | null; createdAt: string; updatedAt: string; userId: string | null; storeId: string; couponId: string | null; user: { id: string; name: string; email: string; } | null; coupon: { type: "fixed" | "percentage"; value: string; code: string; startDate: string | null; endDate: string | null; } | null; } | null; } | null | undefined;
|
|
12
|
-
|
|
13
|
-
type APICartCreateBody = { variantId: string; quantity: number; cartId?: string | undefined; subscriptionId?: string | null | undefined; };
|
|
14
|
-
|
|
15
|
-
type APICartCreateResult = { lineItems: { productVariant: ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: undefined; price: string; }) | ({ storeId: string | null; product: { bundleProducts: { variant: { storeId: string | null; product: { productTaxRate: { taxRate: { rate: string; }; } | null; id: string; name: string; slug: string; images: string[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; }; createdAt: string; updatedAt: string; position: number; bundleId: string; quantity: number; variantId: string; }[]; id: string; name: string; createdAt: string; updatedAt: string; type: "product" | "bundle"; slug: string; flags: unknown; storeId: string; summary: string | null; images: string[]; active: boolean | null; badge: unknown; bundleDiscountPercentage: string | null; categoryId: string | null; productTaxRate: { createdAt: string; updatedAt: string; taxRateId: string; productId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; productCollections: { position: string | null; productId: string; collectionId: string; collection: { id: string; name: string; image: string | null; createdAt: string; updatedAt: string; description: JSONContent | null; slug: string; filter: unknown; storeId: string; active: boolean; }; }[]; }; id: string; createdAt: string; updatedAt: string; price: string; images: string[]; sku: string | null; calculatedPrice: string | null; stock: number | null; depth: number | null; width: number | null; height: number | null; weight: number | null; digital: string[] | null; shippable: boolean; externalId: string | null; productId: string; attributes: unknown; originalPrice: string; combinations: { createdAt: string; updatedAt: string; productVariantId: string; variantValueId: string; variantValue: { id: string; value: string; variantType: { id: string; label: string; }; }; }[]; } & { price: string; } & { prePromotionPrice: string | null; }); id: string; createdAt: string; updatedAt: string; cartId: string; quantity: number; productVariantId: string; subscriptionId: string | null; subscription: { id: string; createdAt: string; updatedAt: string; storeId: string; productId: string; interval: number; cadence: "month" | "week"; } | null; }[]; id: string; createdAt: string; updatedAt: string; storeId: string; addonData: Record<string, unknown> | null | undefined; couponId: string | null; customerId: string | null; stripePaymentIntentId: string | null; checkoutSessionId: string | null; shippingId: string | null; shippingAddressId: string | null; billingAddressId: string | null; shipping: { id: string; name: string; createdAt: string; updatedAt: string; type: "courier" | "parcel" | "pickup_point" | "in_store"; description: string | null; storeId: string; price: string; minShippingTime: number | null; maxShippingTime: number | null; position: number | null; addonId: string | null; addonData: unknown; countries: string[] | null; shippingAddon: { id: string; name: string; createdAt: string; updatedAt: string; type: "shipping" | "analytics" | "products" | "invoicing"; storeId: string; } | null; shippingTaxRate: { createdAt: string; updatedAt: string; shippingId: string; taxRateId: string; taxRate: { id: string; name: string; createdAt: string; updatedAt: string; storeId: string; rate: string; }; } | null; } | null; coupon: { type: "fixed" | "percentage"; value: string; code: string; startDate: string | null; endDate: string | null; } | null; billingAddress: { id: string; name: string | null; createdAt: string; updatedAt: string; type: "shipping" | "billing" | "merchant"; company: string | null; city: string | null; country: string | null; line1: string | null; line2: string | null; postalCode: string | null; state: string | null; phone: string | null; taxId: string | null; } | null; shippingAddress: { id: string; name: string | null; createdAt: string; updatedAt: string; type: "shipping" | "billing" | "merchant"; company: string | null; city: string | null; country: string | null; line1: string | null; line2: string | null; postalCode: string | null; state: string | null; phone: string | null; taxId: string | null; } | null; customer: { id: string; email: string | null; createdAt: string; updatedAt: string; userId: string | null; storeId: string; couponId: string | null; user: { id: string; name: string; email: string; } | null; coupon: { type: "fixed" | "percentage"; value: string; code: string; startDate: string | null; endDate: string | null; } | null; } | null; } | null | undefined;
|
|
1
|
+
import { APIProductsBrowseQueryParams, APIProductsBrowseResult, APIProductGetByIdParams, APIProductGetByIdResult, APIOrdersBrowseQueryParams, APIOrdersBrowseResult, APIOrderGetByIdParams, APIOrderGetByIdResult, APICartCreateBody, APICartCreateResult, APICartGetResult } from './api-types.js';
|
|
2
|
+
export { APICartAddBody, APICartAddResult, APICartRemoveItemQueryParams, APICartRemoveItemResult, JSONContent } from './api-types.js';
|
|
16
3
|
|
|
17
4
|
interface YnsProviderConfig {
|
|
18
5
|
version: "v1";
|
|
@@ -22,9 +9,11 @@ interface YnsProviderConfig {
|
|
|
22
9
|
declare class YnsProvider {
|
|
23
10
|
#private;
|
|
24
11
|
constructor(config: YnsProviderConfig);
|
|
25
|
-
productBrowse(params:
|
|
12
|
+
productBrowse(params: APIProductsBrowseQueryParams): Promise<APIProductsBrowseResult>;
|
|
26
13
|
productGet(params: APIProductGetByIdParams): Promise<APIProductGetByIdResult | null>;
|
|
27
|
-
|
|
14
|
+
orderBrowse(params: APIOrdersBrowseQueryParams): Promise<APIOrdersBrowseResult>;
|
|
15
|
+
orderGet(params: APIOrderGetByIdParams): Promise<APIOrderGetByIdResult | null>;
|
|
16
|
+
cartUpsert(body: APICartCreateBody): Promise<APICartCreateResult>;
|
|
28
17
|
cartRemoveItem(params: {
|
|
29
18
|
cartId: string;
|
|
30
19
|
variantId: string;
|
|
@@ -34,4 +23,4 @@ declare class YnsProvider {
|
|
|
34
23
|
}): Promise<APICartGetResult | null>;
|
|
35
24
|
}
|
|
36
25
|
|
|
37
|
-
export { YnsProvider };
|
|
26
|
+
export { APICartCreateBody, APICartCreateResult, APICartGetResult, APIOrderGetByIdParams, APIOrderGetByIdResult, APIOrdersBrowseQueryParams, APIOrdersBrowseResult, APIProductGetByIdParams, APIProductGetByIdResult, APIProductsBrowseQueryParams, APIProductsBrowseResult, YnsProvider };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
import"./chunk-PNKB6P4V.js";var n={DEBUG:0,LOG:1,WARN:2,ERROR:3},R=process.env.NEXT_PUBLIC_LOG_LEVEL||"LOG",i=n[R],l="\x1B[0m",m="\x1B[34m",y="\x1B[32m",B="\x1B[33m",w="\x1B[31m",E="\u23F1\uFE0F",$="\u{1F41B}",h="\u2714\uFE0F",A="\u26A0\uFE0F",L="\u274C",f=`${E} `,G=`${m}${$}${l} `,O=`${y}${h}${l} `,v=`${B}${A}${l} `,S=`${w}${L}${l} `,P=u=>{let e=u?`[${u}] `:"";return{getLogger(t){return P([u,t].filter(Boolean).join(" > "))},time(t){i>n.DEBUG||console.time([f,e,t].filter(Boolean).join(" "))},timeEnd(t){i>n.DEBUG||console.timeEnd([f,e,t].filter(Boolean).join(" "))},debug(...t){i>n.DEBUG||console.log(...[G,e,...t].filter(Boolean))},log(...t){i>n.LOG||console.log(...[O,e,...t].filter(Boolean))},dir(t,r){i>n.LOG||console.dir(t,r)},warn(...t){i>n.WARN||console.warn(...[v,e,...t].filter(Boolean))},error(...t){i>n.ERROR||console.error(...[S,e,...t].filter(Boolean))}}},T=P();var I=class{#t;#r=P("YnsProvider");constructor(e){this.#t=e,this.#r.debug("YnsProvider initialized")}async#e(e,t="GET",r){let c=this.#r.getLogger("#restRequest"),s=`${this.#t.endpoint}/api/${this.#t.version}${e}`;c.debug(`Making ${t} request to YNS API: ${s}`);let o=await fetch(s,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.#t.token}`},body:r?JSON.stringify(r):void 0});if(!o.ok){let p=o.headers.get("content-type"),d=`YNS REST request failed: ${t} ${s} ${o.status} ${o.statusText}`;if(p?.includes("application/json"))try{let a=await o.json();d=a.error||a.message||d}catch(a){c.error("Failed to parse YNS error response as JSON",a)}else{let a=await o.text();c.error(`YNS API request failed: ${o.status} ${o.statusText}`,d,a)}throw new Error(d)}let g=o.headers.get("content-type");if(!g?.includes("application/json"))throw new Error(`YNS API returned ${g} instead of JSON for ${e}`);return o.json()}async productBrowse(e){let t=this.#r.getLogger("productBrowse");t.debug("Browsing products with params:",e);let r=new URLSearchParams;e.limit&&r.append("limit",e.limit.toString()),e.offset&&r.append("offset",e.offset.toString()),e.category&&r.append("category",e.category),e.query&&r.append("query",e.query),e.active!==void 0&&r.append("active",e.active.toString()),e.orderBy&&r.append("orderBy",e.orderBy),e.orderDirection&&r.append("orderDirection",e.orderDirection);let s=`/products${r.size?`?${r}`:""}`;t.debug("Constructed pathname:",s);let o=await this.#e(s);return t.debug("Received product browse result:",{meta:o.meta}),o}async productGet(e){let t=`/products/${e.idOrSlug}`,r=await this.#e(t);return r||null}async orderBrowse(e){let t=this.#r.getLogger("orderBrowse");t.debug("Browsing orders with params:",e);let r=new URLSearchParams;e.limit&&r.append("limit",e.limit.toString()),e.offset&&r.append("offset",e.offset.toString());let s=`/orders${r.size?`?${r}`:""}`;t.debug("Constructed pathname:",s);let o=await this.#e(s);return t.debug("Received orders browse result:",{meta:o.meta}),o}async orderGet(e){let t=`/orders/${e.id}`,r=await this.#e(t);return r||null}async cartUpsert(e){return await this.#e("/carts","POST",e)}async cartRemoveItem(e){let t=`/carts/${e.cartId}/line-items/${e.variantId}`,r=await this.#e(t,"DELETE");return null}async cartGet(e){let t=`/carts/${e.cartId}`;return await this.#e(t)}};export{I as YnsProvider};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/yns.ts"],"sourcesContent":["import type {\n\tAPICartCreateBody,\n\tAPICartCreateResult,\n\tAPICartGetResult,\n\tAPIProductGetByIdParams,\n\tAPIProductGetByIdResult,\n\tAPIProductsBrowseParams,\n\tAPIProductsBrowseResult,\n} from \"../api-types\";\n\ninterface YnsProviderConfig {\n\tversion: \"v1\";\n\tendpoint: string;\n\ttoken: string;\n}\n\nexport class YnsProvider {\n\t#config;\n\tconstructor(config: YnsProviderConfig) {\n\t\tthis.#config = config;\n\t}\n\n\tasync #restRequest<T>(\n\t\tpathname: `/${string}`,\n\t\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" = \"GET\",\n\t\tbody?: unknown,\n\t): Promise<T> {\n\t\tconst response = await fetch(`${this.#config.endpoint}/api/${this.#config.version}${pathname}`, {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\tAuthorization: `Bearer ${this.#config.token}`,\n\t\t\t},\n\t\t\tbody: body ? JSON.stringify(body) : undefined,\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\t// Handle different error types\n\t\t\tconst contentType = response.headers.get(\"content-type\");\n\t\t\tlet errorMessage = `YNS REST request failed: ${response.status} ${response.statusText}`;\n\n\t\t\tif (contentType?.includes(\"application/json\")) {\n\t\t\t\ttry {\n\t\t\t\t\tconst errorData = await response.json();\n\t\t\t\t\terrorMessage = errorData.error || errorData.message || errorMessage;\n\t\t\t\t} catch {\n\t\t\t\t\t// If JSON parsing fails, use default message\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new Error(errorMessage);\n\t\t}\n\n\t\t// Check if response is JSON before parsing\n\t\tconst contentType = response.headers.get(\"content-type\");\n\t\tif (!contentType?.includes(\"application/json\")) {\n\t\t\tthrow new Error(`YNS API returned ${contentType} instead of JSON for ${pathname}`);\n\t\t}\n\n\t\treturn response.json();\n\t}\n\n\tasync productBrowse(params: APIProductsBrowseParams): Promise<APIProductsBrowseResult> {\n\t\tconst queryParams = new URLSearchParams(\n\t\t\tObject.entries(params)\n\t\t\t\t.map(([key, value]) => [key, value ? String(value) : undefined])\n\t\t\t\t.filter(([, value]) => value !== undefined) as [string, string][],\n\t\t);\n\n\t\tif (params.limit) queryParams.append(\"limit\", params.limit.toString());\n\t\tif (params.offset) queryParams.append(\"offset\", params.offset.toString());\n\t\tif (params.category) queryParams.append(\"category\", params.category);\n\t\tif (params.query) queryParams.append(\"query\", params.query);\n\t\tif (params.active !== undefined) queryParams.append(\"active\", params.active.toString());\n\t\tif (params.orderBy) queryParams.append(\"orderBy\", params.orderBy);\n\t\tif (params.orderDirection) queryParams.append(\"orderDirection\", params.orderDirection);\n\n\t\tconst searchParams = queryParams.size ? `?${queryParams}` : \"\";\n\t\tconst pathname = `/products${searchParams}` as const;\n\t\tconst result = await this.#restRequest<APIProductsBrowseResult>(pathname);\n\n\t\treturn result;\n\t}\n\n\tasync productGet(params: APIProductGetByIdParams): Promise<APIProductGetByIdResult | null> {\n\t\tconst pathname = `/products/${params.idOrSlug}` as const;\n\n\t\tconst result = await this.#restRequest<APIProductGetByIdResult>(pathname);\n\n\t\tif (!result) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// @todo implement this endpoint\n\t// async cartAdd(params: APICartAddBody): Promise<APICartAddResult> {\n\t// \tconst body = {\n\t// \t\tvariantId: params.variantId,\n\t// \t\tcartId: params.cartId,\n\t// \t\tquantity: params.quantity,\n\t// \t\tsubscriptionId: params.subscriptionId,\n\t// \t};\n\n\t// \tconst result = await this.#restRequest<APICartCreateResult>(\"/carts\", \"PUT\", body);\n\t// \treturn result;\n\t// }\n\n\tasync cartCreate(body: APICartCreateBody): Promise<APICartCreateResult> {\n\t\tconst result = await this.#restRequest<APICartCreateResult>(\"/carts\", \"POST\", body);\n\t\treturn result;\n\t}\n\n\tasync cartRemoveItem(params: { cartId: string; variantId: string }): Promise<null> {\n\t\tconst pathname = `/carts/${params.cartId}/line-items/${params.variantId}` as const;\n\t\tconst result = await this.#restRequest<unknown>(pathname, \"DELETE\");\n\t\t// return result;\n\t\treturn null;\n\t}\n\n\tasync cartGet(params: { cartId: string }): Promise<APICartGetResult | null> {\n\t\tconst pathname = `/carts/${params.cartId}` as const;\n\t\tconst result = await this.#restRequest<APICartGetResult>(pathname);\n\t\treturn result;\n\t}\n}\n"],"mappings":"AAgBO,IAAMA,EAAN,KAAkB,CACxBC,GACA,YAAYC,EAA2B,CACtC,KAAKD,GAAUC,CAChB,CAEA,KAAMC,GACLC,EACAC,EAA4C,MAC5CC,EACa,CACb,IAAMC,EAAW,MAAM,MAAM,GAAG,KAAKN,GAAQ,QAAQ,QAAQ,KAAKA,GAAQ,OAAO,GAAGG,CAAQ,GAAI,CAC/F,OAAAC,EACA,QAAS,CACR,eAAgB,mBAChB,cAAe,UAAU,KAAKJ,GAAQ,KAAK,EAC5C,EACA,KAAMK,EAAO,KAAK,UAAUA,CAAI,EAAI,MACrC,CAAC,EAED,GAAI,CAACC,EAAS,GAAI,CAEjB,IAAMC,EAAcD,EAAS,QAAQ,IAAI,cAAc,EACnDE,EAAe,4BAA4BF,EAAS,MAAM,IAAIA,EAAS,UAAU,GAErF,GAAIC,GAAa,SAAS,kBAAkB,EAC3C,GAAI,CACH,IAAME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vE,OADe,MAAM,KAAKH,GAAkC,SAAU,OAAQG,CAAI,CAEnF,CAEA,MAAM,eAAeK,EAA8D,CAClF,IAAMP,EAAW,UAAUO,EAAO,MAAM,eAAeA,EAAO,SAAS,GACjEI,EAAS,MAAM,KAAKZ,GAAsBC,EAAU,QAAQ,EAElE,OAAO,IACR,CAEA,MAAM,QAAQO,EAA8D,CAC3E,IAAMP,EAAW,UAAUO,EAAO,MAAM,GAExC,OADe,MAAM,KAAKR,GAA+BC,CAAQ,CAElE,CACD","names":["YnsProvider","#config","config","#restRequest","pathname","method","body","response","contentType","errorMessage","errorData","params","queryParams","key","value","result"]}
|
|
1
|
+
{"version":3,"sources":["../src/logger.ts","../src/providers/yns.ts"],"sourcesContent":["import type { InspectOptions } from \"node:util\";\n\ntype LogParms = [message: unknown, ...optionalParams: unknown[]];\n\n/**\n * Vercel only supports 3 levels of logging. We're adding additional DEBUG level.\n * https://vercel.com/docs/observability/runtime-logs#level\n *\n * ERROR - Fatal for a particular request. Should be fixed sooner than later.\n *\n * WARN - A note on something that should probably be looked at eventually.\n *\n * LOG - Detail on regular operation.\n *\n * DEBUG - Debug only info as well as time and timeEnd functions.\n */\nconst LogLevel = {\n\tDEBUG: 0,\n\tLOG: 1,\n\tWARN: 2,\n\tERROR: 3,\n} as const;\ntype LogLevel = keyof typeof LogLevel;\n\nconst strLogLevel = (process.env.NEXT_PUBLIC_LOG_LEVEL || \"LOG\") as LogLevel;\nconst valueLogLevel = LogLevel[strLogLevel];\n\nconst RESET = \"\\x1b[0m\";\nconst BLUE = \"\\x1b[34m\";\nconst GREEN = \"\\x1b[32m\";\nconst YELLOW = \"\\x1b[33m\";\nconst RED = \"\\x1b[31m\";\n\nconst TIME = `⏱️`;\nconst DEBUG = `🐛`;\nconst OK = `✔️`;\nconst WARN = `⚠️`;\nconst ERROR = `❌`;\n\nconst PREFIX_TIME = `${TIME} `;\nconst PREFIX_DEBUG = `${BLUE}${DEBUG}${RESET} `;\nconst PREFIX_OK = `${GREEN}${OK}${RESET} `;\nconst PREFIX_WARN = `${YELLOW}${WARN}${RESET} `;\nconst PREFIX_ERROR = `${RED}${ERROR}${RESET} `;\n\nexport const getLogger = (groupLabel?: string) => {\n\tconst PREFIX = groupLabel ? `[${groupLabel}] ` : \"\";\n\treturn {\n\t\tgetLogger(subGroupLabel: string) {\n\t\t\treturn getLogger([groupLabel, subGroupLabel].filter(Boolean).join(\" > \"));\n\t\t},\n\t\ttime(label: string) {\n\t\t\tif (valueLogLevel > LogLevel.DEBUG) return;\n\t\t\tconsole.time([PREFIX_TIME, PREFIX, label].filter(Boolean).join(\" \"));\n\t\t},\n\t\ttimeEnd(label: string) {\n\t\t\tif (valueLogLevel > LogLevel.DEBUG) return;\n\t\t\tconsole.timeEnd([PREFIX_TIME, PREFIX, label].filter(Boolean).join(\" \"));\n\t\t},\n\t\tdebug(...args: LogParms) {\n\t\t\tif (valueLogLevel > LogLevel.DEBUG) return;\n\t\t\tconsole.log(...[PREFIX_DEBUG, PREFIX, ...args].filter(Boolean));\n\t\t},\n\t\tlog(...args: LogParms) {\n\t\t\tif (valueLogLevel > LogLevel.LOG) return;\n\t\t\tconsole.log(...[PREFIX_OK, PREFIX, ...args].filter(Boolean));\n\t\t},\n\t\tdir(item?: unknown, options?: InspectOptions) {\n\t\t\tif (valueLogLevel > LogLevel.LOG) return;\n\t\t\tconsole.dir(item, options);\n\t\t},\n\t\twarn(...args: LogParms) {\n\t\t\tif (valueLogLevel > LogLevel.WARN) return;\n\t\t\tconsole.warn(...[PREFIX_WARN, PREFIX, ...args].filter(Boolean));\n\t\t},\n\t\terror(...args: LogParms) {\n\t\t\tif (valueLogLevel > LogLevel.ERROR) return;\n\t\t\tconsole.error(...[PREFIX_ERROR, PREFIX, ...args].filter(Boolean));\n\t\t},\n\t};\n};\n\nexport const logger = getLogger();\n","import type {\n\tAPICartCreateBody,\n\tAPICartCreateResult,\n\tAPICartGetResult,\n\tAPIOrderGetByIdParams,\n\tAPIOrderGetByIdResult,\n\tAPIOrdersBrowseQueryParams,\n\tAPIOrdersBrowseResult,\n\tAPIProductGetByIdParams,\n\tAPIProductGetByIdResult,\n\tAPIProductsBrowseQueryParams,\n\tAPIProductsBrowseResult,\n} from \"../api-types\";\nimport { getLogger } from \"../logger\";\n\ninterface YnsProviderConfig {\n\tversion: \"v1\";\n\tendpoint: string;\n\ttoken: string;\n}\n\nexport class YnsProvider {\n\t#config;\n\t#logger = getLogger(\"YnsProvider\");\n\tconstructor(config: YnsProviderConfig) {\n\t\tthis.#config = config;\n\t\tthis.#logger.debug(\"YnsProvider initialized\");\n\t}\n\n\tasync #restRequest<T>(\n\t\tpathname: `/${string}`,\n\t\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" = \"GET\",\n\t\tbody?: unknown,\n\t): Promise<T> {\n\t\tconst logger = this.#logger.getLogger(\"#restRequest\");\n\n\t\tconst endpoint = `${this.#config.endpoint}/api/${this.#config.version}${pathname}`;\n\t\tlogger.debug(`Making ${method} request to YNS API: ${endpoint}`);\n\t\tconst response = await fetch(endpoint, {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\tAuthorization: `Bearer ${this.#config.token}`,\n\t\t\t},\n\t\t\tbody: body ? JSON.stringify(body) : undefined,\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\t// Handle different error types\n\t\t\tconst contentType = response.headers.get(\"content-type\");\n\t\t\tlet errorMessage = `YNS REST request failed: ${method} ${endpoint} ${response.status} ${response.statusText}`;\n\n\t\t\tif (contentType?.includes(\"application/json\")) {\n\t\t\t\ttry {\n\t\t\t\t\tconst errorData = await response.json();\n\t\t\t\t\terrorMessage = errorData.error || errorData.message || errorMessage;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.error(\"Failed to parse YNS error response as JSON\", error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst errorText = await response.text();\n\t\t\t\tlogger.error(\n\t\t\t\t\t`YNS API request failed: ${response.status} ${response.statusText}`,\n\t\t\t\t\terrorMessage,\n\t\t\t\t\terrorText,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(errorMessage);\n\t\t}\n\n\t\t// Check if response is JSON before parsing\n\t\tconst contentType = response.headers.get(\"content-type\");\n\t\tif (!contentType?.includes(\"application/json\")) {\n\t\t\tthrow new Error(`YNS API returned ${contentType} instead of JSON for ${pathname}`);\n\t\t}\n\n\t\treturn response.json();\n\t}\n\n\tasync productBrowse(params: APIProductsBrowseQueryParams): Promise<APIProductsBrowseResult> {\n\t\tconst logger = this.#logger.getLogger(\"productBrowse\");\n\t\tlogger.debug(\"Browsing products with params:\", params);\n\n\t\tconst queryParams = new URLSearchParams();\n\t\tif (params.limit) queryParams.append(\"limit\", params.limit.toString());\n\t\tif (params.offset) queryParams.append(\"offset\", params.offset.toString());\n\t\tif (params.category) queryParams.append(\"category\", params.category);\n\t\tif (params.query) queryParams.append(\"query\", params.query);\n\t\tif (params.active !== undefined) queryParams.append(\"active\", params.active.toString());\n\t\tif (params.orderBy) queryParams.append(\"orderBy\", params.orderBy);\n\t\tif (params.orderDirection) queryParams.append(\"orderDirection\", params.orderDirection);\n\n\t\tconst searchParams = queryParams.size ? `?${queryParams}` : \"\";\n\t\tconst pathname = `/products${searchParams}` as const;\n\t\tlogger.debug(\"Constructed pathname:\", pathname);\n\t\tconst result = await this.#restRequest<APIProductsBrowseResult>(pathname);\n\t\tlogger.debug(\"Received product browse result:\", { meta: result.meta });\n\t\treturn result;\n\t}\n\n\tasync productGet(params: APIProductGetByIdParams): Promise<APIProductGetByIdResult | null> {\n\t\tconst pathname = `/products/${params.idOrSlug}` as const;\n\n\t\tconst result = await this.#restRequest<APIProductGetByIdResult>(pathname);\n\n\t\tif (!result) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tasync orderBrowse(params: APIOrdersBrowseQueryParams): Promise<APIOrdersBrowseResult> {\n\t\tconst logger = this.#logger.getLogger(\"orderBrowse\");\n\t\tlogger.debug(\"Browsing orders with params:\", params);\n\n\t\tconst queryParams = new URLSearchParams();\n\n\t\tif (params.limit) queryParams.append(\"limit\", params.limit.toString());\n\t\tif (params.offset) queryParams.append(\"offset\", params.offset.toString());\n\n\t\tconst searchParams = queryParams.size ? `?${queryParams}` : \"\";\n\t\tconst pathname = `/orders${searchParams}` as const;\n\t\tlogger.debug(\"Constructed pathname:\", pathname);\n\t\tconst result = await this.#restRequest<APIOrdersBrowseResult>(pathname);\n\t\tlogger.debug(\"Received orders browse result:\", { meta: result.meta });\n\t\treturn result;\n\t}\n\n\tasync orderGet(params: APIOrderGetByIdParams): Promise<APIOrderGetByIdResult | null> {\n\t\tconst pathname = `/orders/${params.id}` as const;\n\n\t\tconst result = await this.#restRequest<APIOrderGetByIdResult>(pathname);\n\n\t\tif (!result) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// @todo\n\t// async cartAdd(params: APICartAddBody): Promise<APICartAddResult> {\n\t// \tconst body = {\n\t// \t\tvariantId: params.variantId,\n\t// \t\tcartId: params.cartId,\n\t// \t\tquantity: params.quantity,\n\t// \t\tsubscriptionId: params.subscriptionId,\n\t// \t};\n\n\t// \tconst result = await this.#restRequest<APICartCreateResult>(\"/carts\", \"PUT\", body);\n\t// \treturn result;\n\t// }\n\n\tasync cartUpsert(body: APICartCreateBody): Promise<APICartCreateResult> {\n\t\tconst result = await this.#restRequest<APICartCreateResult>(\"/carts\", \"POST\", body);\n\t\treturn result;\n\t}\n\n\tasync cartRemoveItem(params: { cartId: string; variantId: string }): Promise<null> {\n\t\tconst pathname = `/carts/${params.cartId}/line-items/${params.variantId}` as const;\n\t\tconst result = await this.#restRequest<unknown>(pathname, \"DELETE\");\n\t\t// return result;\n\t\treturn null;\n\t}\n\n\tasync cartGet(params: { cartId: string }): Promise<APICartGetResult | null> {\n\t\tconst pathname = `/carts/${params.cartId}` as const;\n\t\tconst result = await this.#restRequest<APICartGetResult>(pathname);\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aAAaW,EAAO,QAAQ,GAEvCE,EAAS,MAAM,KAAKd,GAAsCC,CAAQ,EAExE,OAAKa,GACG,IAIT,CAEA,MAAM,YAAYF,EAAoE,CACrF,IAAMR,EAAS,KAAKP,GAAQ,UAAU,aAAa,EACnDO,EAAO,MAAM,+BAAgCQ,CAAM,EAEnD,IAAMC,EAAc,IAAI,gBAEpBD,EAAO,OAAOC,EAAY,OAAO,QAASD,EAAO,MAAM,SAAS,CAAC,EACjEA,EAAO,QAAQC,EAAY,OAAO,SAAUD,EAAO,OAAO,SAAS,CAAC,EAGxE,IAAMX,EAAW,UADIY,EAAY,KAAO,IAAIA,CAAW,GAAK,EACrB,GACvCT,EAAO,MAAM,wBAAyBH,CAAQ,EAC9C,IAAMa,EAAS,MAAM,KAAKd,GAAoCC,CAAQ,EACtE,OAAAG,EAAO,MAAM,iCAAkC,CAAE,KAAMU,EAAO,IAAK,CAAC,EAC7DA,CACR,CAEA,MAAM,SAASF,EAAsE,CACpF,IAAMX,EAAW,WAAWW,EAAO,EAAE,GAE/BE,EAAS,MAAM,KAAKd,GAAoCC,CAAQ,EAEtE,OAAKa,GACG,IAIT,CAeA,MAAM,WAAWX,EAAuD,CAEvE,OADe,MAAM,KAAKH,GAAkC,SAAU,OAAQG,CAAI,CAEnF,CAEA,MAAM,eAAeS,EAA8D,CAClF,IAAMX,EAAW,UAAUW,EAAO,MAAM,eAAeA,EAAO,SAAS,GACjEE,EAAS,MAAM,KAAKd,GAAsBC,EAAU,QAAQ,EAElE,OAAO,IACR,CAEA,MAAM,QAAQW,EAA8D,CAC3E,IAAMX,EAAW,UAAUW,EAAO,MAAM,GAExC,OADe,MAAM,KAAKZ,GAA+BC,CAAQ,CAElE,CACD","names":["LogLevel","strLogLevel","valueLogLevel","RESET","BLUE","GREEN","YELLOW","RED","TIME","DEBUG","OK","WARN","ERROR","PREFIX_TIME","PREFIX_DEBUG","PREFIX_OK","PREFIX_WARN","PREFIX_ERROR","getLogger","groupLabel","PREFIX","subGroupLabel","label","args","item","options","logger","YnsProvider","#config","#logger","getLogger","config","#restRequest","pathname","method","body","logger","endpoint","response","contentType","errorMessage","errorData","error","errorText","params","queryParams","result"]}
|