@spscommerce/asst-api 1.0.1 → 1.1.0

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/zod.cjs CHANGED
@@ -73,7 +73,11 @@ __export(zod_exports, {
73
73
  itemDetailSchema: () => itemDetailSchema,
74
74
  itemDetailViewSchema: () => itemDetailViewSchema,
75
75
  itemErrorDetailsResultSchema: () => itemErrorDetailsResultSchema,
76
+ itemErrorDetailsResultV2Schema: () => itemErrorDetailsResultV2Schema,
76
77
  itemErrorDetailsSchema: () => itemErrorDetailsSchema,
78
+ itemErrorDetailsV2Schema: () => itemErrorDetailsV2Schema,
79
+ itemErrorSummaryResultV2Schema: () => itemErrorSummaryResultV2Schema,
80
+ itemErrorSummaryV2Schema: () => itemErrorSummaryV2Schema,
77
81
  itemHeaderSchema: () => itemHeaderSchema,
78
82
  itemHierarchyResponseSchema: () => itemHierarchyResponseSchema,
79
83
  itemMapSchema: () => itemMapSchema,
@@ -94,6 +98,7 @@ __export(zod_exports, {
94
98
  spsItemIdResponseSchema: () => spsItemIdResponseSchema,
95
99
  tradingPartnerAccessByCompanyIdSchema: () => tradingPartnerAccessByCompanyIdSchema,
96
100
  tradingPartnerStageSchema: () => tradingPartnerStageSchema,
101
+ tradingPartnerStageV2Schema: () => tradingPartnerStageV2Schema,
97
102
  userAccountSchema: () => userAccountSchema,
98
103
  vendorPartnerAttGroupsSchema: () => vendorPartnerAttGroupsSchema
99
104
  });
@@ -4835,7 +4840,7 @@ var userAccountSchema = z.object({
4835
4840
  attributeRegistryViewer: z.boolean()
4836
4841
  });
4837
4842
 
4838
- // lib/errors/models/ItemErrorDetails.ts
4843
+ // lib/errors/v1/models/ItemErrorDetails.ts
4839
4844
  var itemErrorDetailsSchema = z.object({
4840
4845
  errorMessage: z.string(),
4841
4846
  attributeName: z.string().nullable(),
@@ -4846,7 +4851,7 @@ var itemErrorDetailsSchema = z.object({
4846
4851
  repeatableGroupId: z.string().nullish()
4847
4852
  });
4848
4853
 
4849
- // lib/errors/models/ItemErrorDetailsResult.ts
4854
+ // lib/errors/v1/models/ItemErrorDetailsResult.ts
4850
4855
  var itemErrorDetailsResultSchema = z.object({
4851
4856
  itemInfoId: z.number(),
4852
4857
  upc: z.string().nullish(),
@@ -4858,6 +4863,135 @@ var itemErrorDetailsResultSchema = z.object({
4858
4863
  itemErrorDetails: z.array(itemErrorDetailsSchema)
4859
4864
  });
4860
4865
 
4866
+ // lib/items/v2/models/Stage.ts
4867
+ var stageSchema = z.enum([
4868
+ "CORE",
4869
+ "CORE_PLUS",
4870
+ "CORE_ADVANCED",
4871
+ "ENRICHED"
4872
+ ]);
4873
+
4874
+ // lib/items/v2/models/OrgSummary.ts
4875
+ var orgSummarySchema = z.object({
4876
+ ref: z.string(),
4877
+ id: z.string(),
4878
+ name: z.string()
4879
+ });
4880
+
4881
+ // lib/items/v2/models/ItemOrgStageDetails.ts
4882
+ var itemOrgStageDetailsSchema = z.object({
4883
+ /**
4884
+ * When called as retailer, the vendor, else when vendor, the retailer.
4885
+ * */
4886
+ orgSummary: orgSummarySchema,
4887
+ /**
4888
+ * The company id of the retailer or vendor used for matching ItemOrgStageDetails to TradingPartnerStage for ErrorService
4889
+ */
4890
+ companyId: z.number().nullish(),
4891
+ /**
4892
+ * "Standard Requirements" (null) UNLESS the retailer of the item is MSIS Enabled
4893
+ * OTHERWISE the retailer default Stage UNLESS there's a currently active vendor-specific Stage defined
4894
+ * OTHERWISE the trading partnership Stage UNLESS there's a currently active Item Level override defined
4895
+ * OTHERWISE the item level override */
4896
+ stage: stageSchema.nullish(),
4897
+ /**
4898
+ * If the item is valid for the active stage. Note that for "Standard Requirements" or
4899
+ * "Enriched" this cam come directly from the item_doc table, but anything else requires validation
4900
+ */
4901
+ isValid: z.boolean(),
4902
+ /**
4903
+ * Not null if there's an item level policy override for this trading partnership
4904
+ */
4905
+ itemPolicyId: z.string().nullish(),
4906
+ /**
4907
+ * Start date for the Item level Stage if applicable
4908
+ */
4909
+ startDate: z.number().transform((num) => new Date(num * 1e3)).nullish(),
4910
+ /**
4911
+ * End date for the Item level Stage if applicable
4912
+ */
4913
+ endDate: z.number().transform((num) => new Date(num * 1e3)).nullish()
4914
+ });
4915
+
4916
+ // lib/items/v2/models/ItemStatusV2.ts
4917
+ var itemStatusV2Schema = z.object({
4918
+ itemId: z.string(),
4919
+ mostRestrictiveRetailerStage: stageSchema.nullable(),
4920
+ itemOrgStageDetails: z.array(itemOrgStageDetailsSchema)
4921
+ });
4922
+
4923
+ // lib/items/v2/models/ItemStatusV2Response.ts
4924
+ var itemStatusV2ResponseSchema = z.object({
4925
+ itemStatuses: z.array(itemStatusV2Schema)
4926
+ });
4927
+
4928
+ // lib/errors/v2/models/TradingPartnerStage.ts
4929
+ var tradingPartnerStageV2Schema = z.object({
4930
+ companyId: z.number(),
4931
+ companyName: z.string(),
4932
+ stage: stageSchema.nullish(),
4933
+ isValid: z.boolean()
4934
+ });
4935
+
4936
+ // lib/errors/v2/models/ItemErrorSummary.ts
4937
+ var itemErrorSummaryV2Schema = z.object({
4938
+ itemInfoId: z.number(),
4939
+ upc: z.string().nullish(),
4940
+ isbn: z.string().nullish(),
4941
+ gtin: z.string().nullish(),
4942
+ ean: z.string().nullish(),
4943
+ partnumber: z.string().nullish(),
4944
+ colorfamily: z.string().nullish(),
4945
+ fit: z.string().nullish(),
4946
+ productcolordescription: z.string().nullish(),
4947
+ distributioncentercode: z.string().nullish(),
4948
+ accountnumber: z.string().nullish(),
4949
+ erpid: z.string().nullish(),
4950
+ totalErrors: z.number(),
4951
+ tradingPartners: z.array(z.string()),
4952
+ tradingPartnerIds: z.array(z.number()),
4953
+ // These are the stages assigned to the TradingPartners, not the stages of the errors
4954
+ phases: z.array(z.string()),
4955
+ // Same thing for the stage property in here: it's the stage of the Item & TradingPartner, not the stage of the error
4956
+ tradingPartnerStages: z.array(tradingPartnerStageV2Schema),
4957
+ validatedDate: z.number().pipe(z.coerce.date()).nullish()
4958
+ });
4959
+
4960
+ // lib/errors/v2/models/ItemErrorSummaryResult.ts
4961
+ var itemErrorSummaryResultV2Schema = z.object({
4962
+ hasNext: z.boolean(),
4963
+ errors: z.array(itemErrorSummaryV2Schema)
4964
+ });
4965
+
4966
+ // lib/errors/v2/models/ItemErrorDetails.ts
4967
+ var itemErrorDetailsV2Schema = z.object({
4968
+ errorMessage: z.string(),
4969
+ attributeName: z.string(),
4970
+ attributeDbNames: z.array(z.string()),
4971
+ tradingPartnerNames: z.array(z.string()),
4972
+ phases: z.set(stageSchema),
4973
+ tradingPartnerStages: z.array(tradingPartnerStageV2Schema),
4974
+ repeatableGroupId: z.string()
4975
+ });
4976
+
4977
+ // lib/errors/v2/models/ItemErrorDetailsResult.ts
4978
+ var itemErrorDetailsResultV2Schema = z.object({
4979
+ itemInfoId: z.number(),
4980
+ upc: z.string().nullish(),
4981
+ isbn: z.string().nullish(),
4982
+ gtin: z.string().nullish(),
4983
+ partnumber: z.string().nullish(),
4984
+ ean: z.string().nullish(),
4985
+ colorfamily: z.string().nullish(),
4986
+ fit: z.string().nullish(),
4987
+ productcolordescription: z.string().nullish(),
4988
+ distributioncentercode: z.string().nullish(),
4989
+ accountnumber: z.string().nullish(),
4990
+ erpid: z.string().nullish(),
4991
+ itemName: z.string().nullish(),
4992
+ itemErrorDetails: z.array(itemErrorDetailsV2Schema)
4993
+ });
4994
+
4861
4995
  // lib/companies/models/CompanyBriefByOrg.ts
4862
4996
  var companyBriefByOrgSchema = z.object({
4863
4997
  companyId: z.number(),
@@ -4914,7 +5048,11 @@ var companyBriefByOrgSchema = z.object({
4914
5048
  itemDetailSchema,
4915
5049
  itemDetailViewSchema,
4916
5050
  itemErrorDetailsResultSchema,
5051
+ itemErrorDetailsResultV2Schema,
4917
5052
  itemErrorDetailsSchema,
5053
+ itemErrorDetailsV2Schema,
5054
+ itemErrorSummaryResultV2Schema,
5055
+ itemErrorSummaryV2Schema,
4918
5056
  itemHeaderSchema,
4919
5057
  itemHierarchyResponseSchema,
4920
5058
  itemMapSchema,
@@ -4935,6 +5073,7 @@ var companyBriefByOrgSchema = z.object({
4935
5073
  spsItemIdResponseSchema,
4936
5074
  tradingPartnerAccessByCompanyIdSchema,
4937
5075
  tradingPartnerStageSchema,
5076
+ tradingPartnerStageV2Schema,
4938
5077
  userAccountSchema,
4939
5078
  vendorPartnerAttGroupsSchema
4940
5079
  });
package/dist/zod.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- export { d as attrProdTypeSchema, x as attributeDefinitionSchema, y as attributeMetaDataSchema, D as attributeValidValuesSchema, z as attributesByCompanySchema, P as companyBriefByOrgSchema, M as companyRelationshipUpsertBodySchema, n as envSchema, u as exportSchema, r as importErrorsSchema, s as importSchema, t as importsStatusSchema, w as itemCategoriesSearchSchema, G as itemDetailViewSchema, O as itemErrorDetailsResultSchema, F as itemSearchViewSchema, H as localeSchema, J as spreadsheetTemplateSchema, K as tradingPartnerAccessByCompanyIdSchema, N as userAccountSchema, v as vendorPartnerAttGroupsSchema } from './CompanyBriefByOrg-HsKxilwl.js';
2
- export { a1 as attrDatatypeNameEnumSchema, ag as attributeDetailSchema, a2 as attributeGroupSchema, a3 as attributeSummarySchema, a9 as bulbSchema, ae as categoryEnumSchema, ai as componentDetailsSchema, ar as connectionSchema, _ as downLoadItemsParamsSchema, X as exportDayOfWeekEnum, Y as exportFrequencyEnum, Z as exportTypeEnum, W as generateImportTemplateParamsSchema, am as groupedAttributeListSchema, ak as groupedAttributesSchema, ad as groupedItemSchema, al as hierarchyCategorySchema, aj as hierarchyDetailsSchema, at as identityServiceDatetimePreferencesSchema, au as identityServiceOrganizationMetadataSchema, av as identityServiceOrganizationSchema, aw as identityServicePreferencesSchema, ax as identityServiceUserSchema, Q as importDetailSchema, U as importErrorSchema, V as importStatusEnumSchema, $ as itemCategorySchema, ac as itemDetailSchema, az as itemErrorDetailsSchema, a4 as itemHeaderSchema, a0 as itemHierarchyResponseSchema, a5 as itemMapSchema, as as itemPartnerSchema, aa as itemPriceSchema, a6 as itemTableSchema, ab as mediaItemSchema, an as packComponentDetailsSchema, ao as packComponentItemInfoSchema, af as packComponentSchema, a7 as phaseEnumSchema, ay as registeredServiceSchema, ah as repeatableGroupSchema, aq as spreadsheetTemplateCompanySchema, ap as spsItemIdResponseSchema, a8 as tradingPartnerStageSchema } from './zod-9pZn6tpQ.js';
3
- import 'ky-universal';
1
+ export { d as attrProdTypeSchema, z as attributeDefinitionSchema, D as attributeMetaDataSchema, G as attributeValidValuesSchema, F as attributesByCompanySchema, X as companyBriefByOrgSchema, O as companyRelationshipUpsertBodySchema, p as envSchema, x as exportSchema, t as importErrorsSchema, u as importSchema, v as importsStatusSchema, y as itemCategoriesSearchSchema, J as itemDetailViewSchema, Q as itemErrorDetailsResultSchema, R as itemErrorDetailsResultV2Schema, W as itemErrorSummaryResultV2Schema, H as itemSearchViewSchema, K as localeSchema, M as spreadsheetTemplateSchema, N as tradingPartnerAccessByCompanyIdSchema, P as userAccountSchema, w as vendorPartnerAttGroupsSchema } from './CompanyBriefByOrg-QIqfCtA_.js';
2
+ export { a4 as attrDatatypeNameEnumSchema, aj as attributeDetailSchema, a5 as attributeGroupSchema, a6 as attributeSummarySchema, ac as bulbSchema, ah as categoryEnumSchema, al as componentDetailsSchema, au as connectionSchema, a1 as downLoadItemsParamsSchema, _ as exportDayOfWeekEnum, $ as exportFrequencyEnum, a0 as exportTypeEnum, Z as generateImportTemplateParamsSchema, ap as groupedAttributeListSchema, an as groupedAttributesSchema, ag as groupedItemSchema, ao as hierarchyCategorySchema, am as hierarchyDetailsSchema, aw as identityServiceDatetimePreferencesSchema, ax as identityServiceOrganizationMetadataSchema, ay as identityServiceOrganizationSchema, az as identityServicePreferencesSchema, aA as identityServiceUserSchema, W as importDetailSchema, X as importErrorSchema, Y as importStatusEnumSchema, a2 as itemCategorySchema, af as itemDetailSchema, aC as itemErrorDetailsSchema, aE as itemErrorDetailsV2Schema, aD as itemErrorSummaryV2Schema, a7 as itemHeaderSchema, a3 as itemHierarchyResponseSchema, a8 as itemMapSchema, av as itemPartnerSchema, ad as itemPriceSchema, a9 as itemTableSchema, ae as mediaItemSchema, aq as packComponentDetailsSchema, ar as packComponentItemInfoSchema, ai as packComponentSchema, aa as phaseEnumSchema, aB as registeredServiceSchema, ak as repeatableGroupSchema, at as spreadsheetTemplateCompanySchema, as as spsItemIdResponseSchema, ab as tradingPartnerStageSchema, aF as tradingPartnerStageV2Schema } from './zod-FlYA7lT3.js';
4
3
  import 'ky';
5
4
  import 'zod';
package/dist/zod.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- export { d as attrProdTypeSchema, x as attributeDefinitionSchema, y as attributeMetaDataSchema, D as attributeValidValuesSchema, z as attributesByCompanySchema, P as companyBriefByOrgSchema, M as companyRelationshipUpsertBodySchema, n as envSchema, u as exportSchema, r as importErrorsSchema, s as importSchema, t as importsStatusSchema, w as itemCategoriesSearchSchema, G as itemDetailViewSchema, O as itemErrorDetailsResultSchema, F as itemSearchViewSchema, H as localeSchema, J as spreadsheetTemplateSchema, K as tradingPartnerAccessByCompanyIdSchema, N as userAccountSchema, v as vendorPartnerAttGroupsSchema } from './CompanyBriefByOrg-HsKxilwl.js';
2
- export { a1 as attrDatatypeNameEnumSchema, ag as attributeDetailSchema, a2 as attributeGroupSchema, a3 as attributeSummarySchema, a9 as bulbSchema, ae as categoryEnumSchema, ai as componentDetailsSchema, ar as connectionSchema, _ as downLoadItemsParamsSchema, X as exportDayOfWeekEnum, Y as exportFrequencyEnum, Z as exportTypeEnum, W as generateImportTemplateParamsSchema, am as groupedAttributeListSchema, ak as groupedAttributesSchema, ad as groupedItemSchema, al as hierarchyCategorySchema, aj as hierarchyDetailsSchema, at as identityServiceDatetimePreferencesSchema, au as identityServiceOrganizationMetadataSchema, av as identityServiceOrganizationSchema, aw as identityServicePreferencesSchema, ax as identityServiceUserSchema, Q as importDetailSchema, U as importErrorSchema, V as importStatusEnumSchema, $ as itemCategorySchema, ac as itemDetailSchema, az as itemErrorDetailsSchema, a4 as itemHeaderSchema, a0 as itemHierarchyResponseSchema, a5 as itemMapSchema, as as itemPartnerSchema, aa as itemPriceSchema, a6 as itemTableSchema, ab as mediaItemSchema, an as packComponentDetailsSchema, ao as packComponentItemInfoSchema, af as packComponentSchema, a7 as phaseEnumSchema, ay as registeredServiceSchema, ah as repeatableGroupSchema, aq as spreadsheetTemplateCompanySchema, ap as spsItemIdResponseSchema, a8 as tradingPartnerStageSchema } from './zod-9pZn6tpQ.js';
3
- import 'ky-universal';
1
+ export { d as attrProdTypeSchema, z as attributeDefinitionSchema, D as attributeMetaDataSchema, G as attributeValidValuesSchema, F as attributesByCompanySchema, X as companyBriefByOrgSchema, O as companyRelationshipUpsertBodySchema, p as envSchema, x as exportSchema, t as importErrorsSchema, u as importSchema, v as importsStatusSchema, y as itemCategoriesSearchSchema, J as itemDetailViewSchema, Q as itemErrorDetailsResultSchema, R as itemErrorDetailsResultV2Schema, W as itemErrorSummaryResultV2Schema, H as itemSearchViewSchema, K as localeSchema, M as spreadsheetTemplateSchema, N as tradingPartnerAccessByCompanyIdSchema, P as userAccountSchema, w as vendorPartnerAttGroupsSchema } from './CompanyBriefByOrg-QIqfCtA_.js';
2
+ export { a4 as attrDatatypeNameEnumSchema, aj as attributeDetailSchema, a5 as attributeGroupSchema, a6 as attributeSummarySchema, ac as bulbSchema, ah as categoryEnumSchema, al as componentDetailsSchema, au as connectionSchema, a1 as downLoadItemsParamsSchema, _ as exportDayOfWeekEnum, $ as exportFrequencyEnum, a0 as exportTypeEnum, Z as generateImportTemplateParamsSchema, ap as groupedAttributeListSchema, an as groupedAttributesSchema, ag as groupedItemSchema, ao as hierarchyCategorySchema, am as hierarchyDetailsSchema, aw as identityServiceDatetimePreferencesSchema, ax as identityServiceOrganizationMetadataSchema, ay as identityServiceOrganizationSchema, az as identityServicePreferencesSchema, aA as identityServiceUserSchema, W as importDetailSchema, X as importErrorSchema, Y as importStatusEnumSchema, a2 as itemCategorySchema, af as itemDetailSchema, aC as itemErrorDetailsSchema, aE as itemErrorDetailsV2Schema, aD as itemErrorSummaryV2Schema, a7 as itemHeaderSchema, a3 as itemHierarchyResponseSchema, a8 as itemMapSchema, av as itemPartnerSchema, ad as itemPriceSchema, a9 as itemTableSchema, ae as mediaItemSchema, aq as packComponentDetailsSchema, ar as packComponentItemInfoSchema, ai as packComponentSchema, aa as phaseEnumSchema, aB as registeredServiceSchema, ak as repeatableGroupSchema, at as spreadsheetTemplateCompanySchema, as as spsItemIdResponseSchema, ab as tradingPartnerStageSchema, aF as tradingPartnerStageV2Schema } from './zod-FlYA7lT3.js';
4
3
  import 'ky';
5
4
  import 'zod';
package/dist/zod.js CHANGED
@@ -42,7 +42,11 @@ import {
42
42
  itemDetailSchema,
43
43
  itemDetailViewSchema,
44
44
  itemErrorDetailsResultSchema,
45
+ itemErrorDetailsResultV2Schema,
45
46
  itemErrorDetailsSchema,
47
+ itemErrorDetailsV2Schema,
48
+ itemErrorSummaryResultV2Schema,
49
+ itemErrorSummaryV2Schema,
46
50
  itemHeaderSchema,
47
51
  itemHierarchyResponseSchema,
48
52
  itemMapSchema,
@@ -63,9 +67,10 @@ import {
63
67
  spsItemIdResponseSchema,
64
68
  tradingPartnerAccessByCompanyIdSchema,
65
69
  tradingPartnerStageSchema,
70
+ tradingPartnerStageV2Schema,
66
71
  userAccountSchema,
67
72
  vendorPartnerAttGroupsSchema
68
- } from "./chunk-6FFDMMN5.js";
73
+ } from "./chunk-3EK6JHC5.js";
69
74
  export {
70
75
  attrDatatypeNameEnumSchema,
71
76
  attrProdTypeSchema,
@@ -110,7 +115,11 @@ export {
110
115
  itemDetailSchema,
111
116
  itemDetailViewSchema,
112
117
  itemErrorDetailsResultSchema,
118
+ itemErrorDetailsResultV2Schema,
113
119
  itemErrorDetailsSchema,
120
+ itemErrorDetailsV2Schema,
121
+ itemErrorSummaryResultV2Schema,
122
+ itemErrorSummaryV2Schema,
114
123
  itemHeaderSchema,
115
124
  itemHierarchyResponseSchema,
116
125
  itemMapSchema,
@@ -131,6 +140,7 @@ export {
131
140
  spsItemIdResponseSchema,
132
141
  tradingPartnerAccessByCompanyIdSchema,
133
142
  tradingPartnerStageSchema,
143
+ tradingPartnerStageV2Schema,
134
144
  userAccountSchema,
135
145
  vendorPartnerAttGroupsSchema
136
146
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Assortment Api is a collection of HTTP functions to use Assortment endpoints",
4
4
  "author": "Assortment",
5
5
  "repository": "https://github.com/SPSCommerce/assortment-main/tree/main/ui/packages/asst-api",
6
- "version": "1.0.1",
6
+ "version": "1.1.0",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
@@ -51,8 +51,8 @@
51
51
  "vite": "^4.1.0"
52
52
  },
53
53
  "dependencies": {
54
- "ky": "^0.33.3",
55
- "ky-universal": "^0.11.0"
54
+ "ky": "^0.25.1",
55
+ "ky-universal": "^0.8.2"
56
56
  },
57
57
  "msw": {
58
58
  "workerDirectory": "public"