bitsnap-react 1.3.5 → 1.3.7
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/index.mjs +73 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/errors.js +0 -2
- package/dist/errors.js.map +0 -1
- package/dist/index.js +0 -4626
- package/dist/index.js.map +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/models.js +0 -106
- package/dist/models.js.map +0 -1
package/dist/internal.js
DELETED
package/dist/internal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/models.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/models.ts
|
|
31
|
-
var models_exports = {};
|
|
32
|
-
__export(models_exports, {
|
|
33
|
-
BitsnapModels: () => BitsnapModels
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(models_exports);
|
|
36
|
-
var z = __toESM(require("zod"));
|
|
37
|
-
var BitsnapModels;
|
|
38
|
-
((BitsnapModels2) => {
|
|
39
|
-
BitsnapModels2.BaselinkerFieldsSchema = z.object({
|
|
40
|
-
storageID: z.string().optional()
|
|
41
|
-
});
|
|
42
|
-
BitsnapModels2.MetadataSchema = z.record(z.string(), z.any());
|
|
43
|
-
BitsnapModels2.VariantSchema = z.object({
|
|
44
|
-
id: z.string(),
|
|
45
|
-
name: z.string(),
|
|
46
|
-
price: z.number(),
|
|
47
|
-
currency: z.string(),
|
|
48
|
-
metadata: BitsnapModels2.MetadataSchema.optional(),
|
|
49
|
-
images: z.array(z.string()),
|
|
50
|
-
availableQuantity: z.number().optional(),
|
|
51
|
-
isDeliverable: z.boolean().optional(),
|
|
52
|
-
estimatedDeliveryAt: z.number().optional()
|
|
53
|
-
});
|
|
54
|
-
BitsnapModels2.AdditionalSchema = z.object({
|
|
55
|
-
sku: z.string().optional(),
|
|
56
|
-
baselinkerFields: BitsnapModels2.BaselinkerFieldsSchema.optional(),
|
|
57
|
-
isPresale: z.boolean().optional()
|
|
58
|
-
});
|
|
59
|
-
BitsnapModels2.ItemSchema = z.object({
|
|
60
|
-
id: z.string(),
|
|
61
|
-
ownerID: z.string().optional(),
|
|
62
|
-
name: z.string(),
|
|
63
|
-
description: z.union([z.string(), z.null()]).optional(),
|
|
64
|
-
createdAt: z.number().optional(),
|
|
65
|
-
updatedAt: z.number().optional(),
|
|
66
|
-
price: z.number(),
|
|
67
|
-
currency: z.string(),
|
|
68
|
-
metadata: BitsnapModels2.MetadataSchema.optional(),
|
|
69
|
-
image_url: z.string(),
|
|
70
|
-
images: z.array(z.string()),
|
|
71
|
-
isDeliverable: z.boolean().optional(),
|
|
72
|
-
availableQuantity: z.number().optional(),
|
|
73
|
-
additional: BitsnapModels2.AdditionalSchema.optional(),
|
|
74
|
-
variants: z.array(BitsnapModels2.VariantSchema).optional(),
|
|
75
|
-
estimatedDeliveryAt: z.number().optional()
|
|
76
|
-
});
|
|
77
|
-
BitsnapModels2.DataSchema = z.object({
|
|
78
|
-
success: z.boolean(),
|
|
79
|
-
result: z.array(BitsnapModels2.ItemSchema),
|
|
80
|
-
totalCount: z.number()
|
|
81
|
-
});
|
|
82
|
-
BitsnapModels2.ProductsResultResultSchema = z.object({
|
|
83
|
-
data: BitsnapModels2.DataSchema
|
|
84
|
-
});
|
|
85
|
-
BitsnapModels2.ProductsResultElementSchema = z.array(
|
|
86
|
-
z.object({
|
|
87
|
-
result: BitsnapModels2.ProductsResultResultSchema
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
|
-
BitsnapModels2.ProductResultSchema = z.array(
|
|
91
|
-
z.object({
|
|
92
|
-
result: z.object({
|
|
93
|
-
data: z.object({
|
|
94
|
-
success: z.boolean(),
|
|
95
|
-
message: z.string().optional(),
|
|
96
|
-
result: BitsnapModels2.ItemSchema.optional()
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
);
|
|
101
|
-
})(BitsnapModels || (BitsnapModels = {}));
|
|
102
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
-
0 && (module.exports = {
|
|
104
|
-
BitsnapModels
|
|
105
|
-
});
|
|
106
|
-
//# sourceMappingURL=models.js.map
|
package/dist/models.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAmB;AAEZ,IAAU;AAAA,CAAV,CAAUA,mBAAV;AACE,EAAMA,eAAA,yBAA2B,SAAO;AAAA,IAC7C,WAAa,SAAO,EAAE,SAAS;AAAA,EACjC,CAAC;AAGM,EAAMA,eAAA,iBAAmB,SAAS,SAAO,GAAK,MAAI,CAAC;AAEnD,EAAMA,eAAA,gBAAkB,SAAO;AAAA,IACpC,IAAM,SAAO;AAAA,IACb,MAAQ,SAAO;AAAA,IACf,OAAS,SAAO;AAAA,IAChB,UAAY,SAAO;AAAA,IACnB,UAAUA,eAAA,eAAe,SAAS;AAAA,IAClC,QAAU,QAAQ,SAAO,CAAC;AAAA,IAC1B,mBAAqB,SAAO,EAAE,SAAS;AAAA,IACvC,eAAiB,UAAQ,EAAE,SAAS;AAAA,IACpC,qBAAuB,SAAO,EAAE,SAAS;AAAA,EAC3C,CAAC;AAGM,EAAMA,eAAA,mBAAqB,SAAO;AAAA,IACvC,KAAO,SAAO,EAAE,SAAS;AAAA,IACzB,kBAAkBA,eAAA,uBAAuB,SAAS;AAAA,IAClD,WAAa,UAAQ,EAAE,SAAS;AAAA,EAClC,CAAC;AAGM,EAAMA,eAAA,aAAe,SAAO;AAAA,IACjC,IAAM,SAAO;AAAA,IACb,SAAW,SAAO,EAAE,SAAS;AAAA,IAC7B,MAAQ,SAAO;AAAA,IACf,aAAe,QAAM,CAAG,SAAO,GAAK,OAAK,CAAC,CAAC,EAAE,SAAS;AAAA,IACtD,WAAa,SAAO,EAAE,SAAS;AAAA,IAC/B,WAAa,SAAO,EAAE,SAAS;AAAA,IAC/B,OAAS,SAAO;AAAA,IAChB,UAAY,SAAO;AAAA,IACnB,UAAUA,eAAA,eAAe,SAAS;AAA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