@spscommerce/asst-api 0.1.0 → 0.2.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.
@@ -289,6 +289,27 @@ declare const attrProdTypeSchema: z.ZodObject<{
289
289
  }>;
290
290
  type AttrProdType = z.infer<typeof attrProdTypeSchema>;
291
291
 
292
+ declare const companyRelationshipUpsertBodySchema: z.ZodObject<{
293
+ supplierId: z.ZodNumber;
294
+ retailerId: z.ZodNumber;
295
+ catalogId: z.ZodNumber;
296
+ isActive: z.ZodBoolean;
297
+ applicationType: z.ZodDefault<z.ZodArray<z.ZodEnum<["ASSORTMENT", "ITEM-XREF"]>, "many">>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ isActive: boolean;
300
+ retailerId: number;
301
+ supplierId: number;
302
+ catalogId: number;
303
+ applicationType: ("ASSORTMENT" | "ITEM-XREF")[];
304
+ }, {
305
+ isActive: boolean;
306
+ retailerId: number;
307
+ supplierId: number;
308
+ catalogId: number;
309
+ applicationType?: ("ASSORTMENT" | "ITEM-XREF")[] | undefined;
310
+ }>;
311
+ type CompanyRelationshipUpsertBody = z.infer<typeof companyRelationshipUpsertBodySchema>;
312
+
292
313
  declare const tradingPartnerAccessByCompanyIdSchema: z.ZodObject<{
293
314
  companyId: z.ZodNumber;
294
315
  companyType: z.ZodString;
@@ -3135,4 +3156,4 @@ declare const companyBriefByOrgSchema: z.ZodObject<{
3135
3156
  }>;
3136
3157
  type CompanyBriefByOrg = z.infer<typeof companyBriefByOrgSchema>;
3137
3158
 
3138
- export { AsstClient as A, BASE_URLS as B, CompanyBriefByOrg as C, itemSearchViewSchema as D, Export as E, itemDetailViewSchema as F, localeSchema as G, spreadsheetTemplateSchema as H, ImportErrors as I, tradingPartnerAccessByCompanyIdSchema as J, userAccountSchema as K, Locale as L, itemErrorDetailsResultSchema as M, companyBriefByOrgSchema as N, SpreadsheetTemplate as S, TradingPartnerAccessByCompanyId as T, UserAccount as U, VendorPartnerAttGroups as V, Import as a, ImportsStatus as b, ItemCategoriesSearch as c, attrProdTypeSchema as d, ItemErrorDetailsResult as e, ItemSearchView as f, ItemDetailView as g, AttributeMetaData as h, AttributesByCompany as i, AttributeDefinition as j, AttributeValidValues as k, AttrProdType as l, AsstClientOptions as m, AsstUrl as n, Env as o, envSchema as p, importErrorsSchema as q, importSchema as r, importsStatusSchema as s, exportSchema as t, itemCategoriesSearchSchema as u, vendorPartnerAttGroupsSchema as v, attributeDefinitionSchema as w, attributeMetaDataSchema as x, attributesByCompanySchema as y, attributeValidValuesSchema as z };
3159
+ export { AsstClient as A, BASE_URLS as B, CompanyBriefByOrg as C, attributeValidValuesSchema as D, Export as E, itemSearchViewSchema as F, itemDetailViewSchema as G, localeSchema as H, ImportErrors as I, spreadsheetTemplateSchema as J, tradingPartnerAccessByCompanyIdSchema as K, Locale as L, companyRelationshipUpsertBodySchema as M, userAccountSchema as N, itemErrorDetailsResultSchema as O, companyBriefByOrgSchema as P, SpreadsheetTemplate as S, TradingPartnerAccessByCompanyId as T, UserAccount as U, VendorPartnerAttGroups as V, Import as a, ImportsStatus as b, ItemCategoriesSearch as c, attrProdTypeSchema as d, CompanyRelationshipUpsertBody as e, ItemErrorDetailsResult as f, ItemSearchView as g, ItemDetailView as h, AttributeMetaData as i, AttributesByCompany as j, AttributeDefinition as k, AttributeValidValues as l, AttrProdType as m, envSchema as n, AsstClientOptions as o, AsstUrl as p, Env as q, importErrorsSchema as r, importSchema as s, importsStatusSchema as t, exportSchema as u, vendorPartnerAttGroupsSchema as v, itemCategoriesSearchSchema as w, attributeDefinitionSchema as x, attributeMetaDataSchema as y, attributesByCompanySchema as z };
@@ -21,7 +21,7 @@ import {
21
21
  userAccountSchema,
22
22
  vendorPartnerAttGroupsSchema,
23
23
  z
24
- } from "./chunk-PUQDOFRT.js";
24
+ } from "./chunk-VICSFYTR.js";
25
25
 
26
26
  // lib/imports/index.ts
27
27
  var BASE_URL = "imports";
@@ -145,8 +145,16 @@ function createTradingPartnerAccessApi(client) {
145
145
  }).json();
146
146
  return tradingPartnerAccessByCompanyIdSchema.parse(data);
147
147
  }
148
+ async function upsertRelationship(data) {
149
+ return await client.post(`${BASE_URL4}/upsert-relationship`, { json: data }).json();
150
+ }
151
+ async function upsertHierarchy(data) {
152
+ await client.post(`${BASE_URL4}/upsert-hierarchy`, { json: data }).json();
153
+ }
148
154
  return {
149
- getAllTradingPartners
155
+ getAllTradingPartners,
156
+ upsertRelationship,
157
+ upsertHierarchy
150
158
  };
151
159
  }
152
160
 
@@ -4437,6 +4437,27 @@ var connectionSchema = z.object({
4437
4437
  partner_org_id: z.string()
4438
4438
  });
4439
4439
 
4440
+ // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4441
+ var companyRelationshipUpsertBodySchema = z.object({
4442
+ supplierId: z.number(),
4443
+ retailerId: z.number(),
4444
+ catalogId: z.number(),
4445
+ isActive: z.boolean(),
4446
+ applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4447
+ });
4448
+
4449
+ // lib/tradingPartners/models/ItemPartner.ts
4450
+ var itemPartnerSchema = z.object({
4451
+ itemPartnerId: z.number(),
4452
+ retailerId: z.number(),
4453
+ supplierId: z.number(),
4454
+ catalogId: z.number(),
4455
+ isActive: z.number(),
4456
+ createdDate: z.string(),
4457
+ modifiedDate: z.string(),
4458
+ applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4459
+ });
4460
+
4440
4461
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4441
4462
  var tradingPartnerAccessByCompanyIdSchema = z.object({
4442
4463
  companyId: z.number(),
@@ -4591,6 +4612,8 @@ export {
4591
4612
  attrProdTypeSchema,
4592
4613
  pagedResultsSchema,
4593
4614
  connectionSchema,
4615
+ companyRelationshipUpsertBodySchema,
4616
+ itemPartnerSchema,
4594
4617
  tradingPartnerAccessByCompanyIdSchema,
4595
4618
  itemCategorySchema,
4596
4619
  itemCategoriesSearchSchema,
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { A as AsstClient, C as CompanyBriefByOrg } from './CompanyBriefByOrg-f1bfabb3.js';
2
+ import { A as AsstClient, C as CompanyBriefByOrg } from './CompanyBriefByOrg-eea5479d.js';
3
3
 
4
4
  declare const itemStatusResponseSchema: z.ZodObject<{
5
5
  itemStatuses: z.ZodArray<z.ZodObject<{
package/dist/index.cjs CHANGED
@@ -46,7 +46,8 @@ __export(lib_exports, {
46
46
  createSpreadsheetTemplateApi: () => createSpreadsheetTemplateApi,
47
47
  createTradingPartnerAccessApi: () => createTradingPartnerAccessApi,
48
48
  createUniqueCriteriaApi: () => createUniqueCriteriaApi,
49
- createWhoAmIApi: () => createWhoAmIApi
49
+ createWhoAmIApi: () => createWhoAmIApi,
50
+ envSchema: () => envSchema
50
51
  });
51
52
  module.exports = __toCommonJS(lib_exports);
52
53
 
@@ -4009,6 +4010,27 @@ var connectionSchema = z.object({
4009
4010
  partner_org_id: z.string()
4010
4011
  });
4011
4012
 
4013
+ // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4014
+ var companyRelationshipUpsertBodySchema = z.object({
4015
+ supplierId: z.number(),
4016
+ retailerId: z.number(),
4017
+ catalogId: z.number(),
4018
+ isActive: z.boolean(),
4019
+ applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4020
+ });
4021
+
4022
+ // lib/tradingPartners/models/ItemPartner.ts
4023
+ var itemPartnerSchema = z.object({
4024
+ itemPartnerId: z.number(),
4025
+ retailerId: z.number(),
4026
+ supplierId: z.number(),
4027
+ catalogId: z.number(),
4028
+ isActive: z.number(),
4029
+ createdDate: z.string(),
4030
+ modifiedDate: z.string(),
4031
+ applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4032
+ });
4033
+
4012
4034
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4013
4035
  var tradingPartnerAccessByCompanyIdSchema = z.object({
4014
4036
  companyId: z.number(),
@@ -4029,8 +4051,16 @@ function createTradingPartnerAccessApi(client) {
4029
4051
  }).json();
4030
4052
  return tradingPartnerAccessByCompanyIdSchema.parse(data);
4031
4053
  }
4054
+ async function upsertRelationship(data) {
4055
+ return await client.post(`${BASE_URL4}/upsert-relationship`, { json: data }).json();
4056
+ }
4057
+ async function upsertHierarchy(data) {
4058
+ await client.post(`${BASE_URL4}/upsert-hierarchy`, { json: data }).json();
4059
+ }
4032
4060
  return {
4033
- getAllTradingPartners
4061
+ getAllTradingPartners,
4062
+ upsertRelationship,
4063
+ upsertHierarchy
4034
4064
  };
4035
4065
  }
4036
4066
 
@@ -5016,5 +5046,6 @@ function createCompaniesApi(client) {
5016
5046
  createSpreadsheetTemplateApi,
5017
5047
  createTradingPartnerAccessApi,
5018
5048
  createUniqueCriteriaApi,
5019
- createWhoAmIApi
5049
+ createWhoAmIApi,
5050
+ envSchema
5020
5051
  });
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { A as AsstClient, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, E as Export, l as AttrProdType, T as TradingPartnerAccessByCompanyId, c as ItemCategoriesSearch, h as AttributeMetaData, i as AttributesByCompany, j as AttributeDefinition, k as AttributeValidValues, L as Locale, S as SpreadsheetTemplate, U as UserAccount, f as ItemSearchView, g as ItemDetailView, e as ItemErrorDetailsResult } from './CompanyBriefByOrg-f1bfabb3.js';
2
- export { m as AsstClientOptions, n as AsstUrl, B as BASE_URLS, C as CompanyBriefByOrg, o as Env, I as ImportErrors } from './CompanyBriefByOrg-f1bfabb3.js';
3
- import { G as GenerateImportTemplateParams, D as DownLoadItemsParams, I as ItemHierarchyResponse, a as ItemDetail, S as SpsItemIdResponse } from './zod-ec1cdb27.js';
4
- export { i as AttrDatatypeNameEnum, t as AttributeDetail, j as AttributeGroup, A as AttributeSummary, K as Bulb, u as CategoryEnum, v as ComponentDetails, C as Connection, E as ExportDayOfWeek, e as ExportFrequency, f as ExportType, w as GroupedAttributeList, x as GroupedAttributes, y as GroupedItem, H as Hierarchy, z as HierarchyCategory, B as HierarchyDetails, m as IdentityServiceDatetimePreferences, n as IdentityServiceOrganization, l as IdentityServiceOrganizationMetadata, o as IdentityServicePreferences, p as IdentityServiceUser, b as ImportDetails, c as ImportError, d as ImportStatusEnum, g as ItemCategory, Q as ItemErrorDetails, q as ItemHeader, h as ItemHierarchy, r as ItemMap, F as ItemPrice, s as ItemTable, M as MediaItem, L as PackComponent, J as PackComponentDetails, O as PackComponentItemInfo, P as PhaseEnum, R as RegisteredService, N as RepeatableGroup, k as SpreadsheetTemplateCompany, T as TradingPartnerStage } from './zod-ec1cdb27.js';
5
- import { I as ItemStatusResponse } from './index-d94fdfef.js';
6
- export { c as createCompaniesApi } from './index-d94fdfef.js';
1
+ import { A as AsstClient, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, E as Export, m as AttrProdType, T as TradingPartnerAccessByCompanyId, e as CompanyRelationshipUpsertBody, c as ItemCategoriesSearch, i as AttributeMetaData, j as AttributesByCompany, k as AttributeDefinition, l as AttributeValidValues, L as Locale, S as SpreadsheetTemplate, U as UserAccount, g as ItemSearchView, h as ItemDetailView, f as ItemErrorDetailsResult } from './CompanyBriefByOrg-eea5479d.js';
2
+ export { o as AsstClientOptions, p as AsstUrl, B as BASE_URLS, C as CompanyBriefByOrg, q as Env, I as ImportErrors, n as envSchema } from './CompanyBriefByOrg-eea5479d.js';
3
+ import { G as GenerateImportTemplateParams, D as DownLoadItemsParams, I as ItemPartner, a as ItemHierarchyResponse, b as ItemDetail, S as SpsItemIdResponse } from './zod-5a9153f1.js';
4
+ export { j as AttrDatatypeNameEnum, u as AttributeDetail, k as AttributeGroup, A as AttributeSummary, L as Bulb, v as CategoryEnum, w as ComponentDetails, C as Connection, E as ExportDayOfWeek, f as ExportFrequency, g as ExportType, x as GroupedAttributeList, y as GroupedAttributes, z as GroupedItem, H as Hierarchy, B as HierarchyCategory, F as HierarchyDetails, n as IdentityServiceDatetimePreferences, o as IdentityServiceOrganization, m as IdentityServiceOrganizationMetadata, p as IdentityServicePreferences, q as IdentityServiceUser, c as ImportDetails, d as ImportError, e as ImportStatusEnum, h as ItemCategory, U as ItemErrorDetails, r as ItemHeader, i as ItemHierarchy, s as ItemMap, J as ItemPrice, t as ItemTable, M as MediaItem, N as PackComponent, K as PackComponentDetails, Q as PackComponentItemInfo, P as PhaseEnum, R as RegisteredService, O as RepeatableGroup, l as SpreadsheetTemplateCompany, T as TradingPartnerStage } from './zod-5a9153f1.js';
5
+ import { I as ItemStatusResponse } from './index-ba0dd228.js';
6
+ export { c as createCompaniesApi } from './index-ba0dd228.js';
7
7
  import { z } from 'zod';
8
8
  import 'ky-universal';
9
9
  import 'ky';
@@ -70,6 +70,8 @@ declare function createTradingPartnerAccessApi(client: AsstClient): {
70
70
  getAllTradingPartners: (params?: {
71
71
  orgId?: string;
72
72
  }, signal?: AbortSignal) => Promise<TradingPartnerAccessByCompanyId>;
73
+ upsertRelationship: (data: CompanyRelationshipUpsertBody) => Promise<ItemPartner>;
74
+ upsertHierarchy: (data: CompanyRelationshipUpsertBody) => Promise<void>;
73
75
  };
74
76
 
75
77
  /**
@@ -297,4 +299,4 @@ declare function createUniqueCriteriaApi(client: AsstClient): {
297
299
  }, signal?: AbortSignal) => Promise<string[]>;
298
300
  };
299
301
 
300
- export { AsstClient, AttrProdType, AttributeDefinition, AttributeMetaData, AttributeValidValues, AttributesByCompany, DownLoadItemsParams, Export, GenerateImportTemplateParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemHierarchyResponse, ItemOrgStatus, ItemSearchView, ItemStatus, ItemStatusResponse, Locale, SpreadsheetTemplate, SpsItemIdResponse, TradingPartnerAccessByCompanyId, UserAccount, VendorPartnerAttGroups, createAttributesApi, createCategoriesApi, createCompanyFeaturesApi, createErrorsApi, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createUniqueCriteriaApi, createWhoAmIApi };
302
+ export { AsstClient, AttrProdType, AttributeDefinition, AttributeMetaData, AttributeValidValues, AttributesByCompany, CompanyRelationshipUpsertBody, DownLoadItemsParams, Export, GenerateImportTemplateParams, Import, ImportsStatus, ItemCategoriesSearch, ItemDetail, ItemDetailView, ItemErrorDetailsResult, ItemHierarchyResponse, ItemOrgStatus, ItemPartner, ItemSearchView, ItemStatus, ItemStatusResponse, Locale, SpreadsheetTemplate, SpsItemIdResponse, TradingPartnerAccessByCompanyId, UserAccount, VendorPartnerAttGroups, createAttributesApi, createCategoriesApi, createCompanyFeaturesApi, createErrorsApi, createExportsApi, createFeatureFlagsApi, createImportsApi, createItemsApi, createLocaleApi, createProductTypesApi, createSpreadsheetTemplateApi, createTradingPartnerAccessApi, createUniqueCriteriaApi, createWhoAmIApi };
package/dist/index.js CHANGED
@@ -14,11 +14,12 @@ import {
14
14
  createTradingPartnerAccessApi,
15
15
  createUniqueCriteriaApi,
16
16
  createWhoAmIApi
17
- } from "./chunk-FDGLFR7X.js";
17
+ } from "./chunk-HBDHFANT.js";
18
18
  import {
19
19
  AsstClient,
20
- BASE_URLS
21
- } from "./chunk-PUQDOFRT.js";
20
+ BASE_URLS,
21
+ envSchema
22
+ } from "./chunk-VICSFYTR.js";
22
23
  export {
23
24
  AsstClient,
24
25
  BASE_URLS,
@@ -36,5 +37,6 @@ export {
36
37
  createSpreadsheetTemplateApi,
37
38
  createTradingPartnerAccessApi,
38
39
  createUniqueCriteriaApi,
39
- createWhoAmIApi
40
+ createWhoAmIApi,
41
+ envSchema
40
42
  };
package/dist/msw.cjs CHANGED
@@ -4038,6 +4038,27 @@ var connectionSchema = z.object({
4038
4038
  partner_org_id: z.string()
4039
4039
  });
4040
4040
 
4041
+ // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4042
+ var companyRelationshipUpsertBodySchema = z.object({
4043
+ supplierId: z.number(),
4044
+ retailerId: z.number(),
4045
+ catalogId: z.number(),
4046
+ isActive: z.boolean(),
4047
+ applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4048
+ });
4049
+
4050
+ // lib/tradingPartners/models/ItemPartner.ts
4051
+ var itemPartnerSchema = z.object({
4052
+ itemPartnerId: z.number(),
4053
+ retailerId: z.number(),
4054
+ supplierId: z.number(),
4055
+ catalogId: z.number(),
4056
+ isActive: z.number(),
4057
+ createdDate: z.string(),
4058
+ modifiedDate: z.string(),
4059
+ applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4060
+ });
4061
+
4041
4062
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4042
4063
  var tradingPartnerAccessByCompanyIdSchema = z.object({
4043
4064
  companyId: z.number(),
@@ -4060,8 +4081,21 @@ function createTradingPartnerAccessApiHandlers(client) {
4060
4081
  return import_msw5.rest.get(`${client.getBaseUrl()}${BASE_URL5}/connections`, resolver);
4061
4082
  }
4062
4083
  getAllTradingPartners.generateData = () => (0, import_zod_mock4.generateMock)(tradingPartnerAccessByCompanyIdSchema);
4084
+ function upsertRelationship(resolver = (_req, res, ctx) => {
4085
+ return res(ctx.status(200));
4086
+ }) {
4087
+ return import_msw5.rest.post(`${BASE_URL5}/upsert-relationship`, resolver);
4088
+ }
4089
+ upsertRelationship.generateData = () => (0, import_zod_mock4.generateMock)(itemPartnerSchema);
4090
+ function upsertHierarchy(resolver = (_req, res, ctx) => {
4091
+ return res(ctx.status(200));
4092
+ }) {
4093
+ return import_msw5.rest.post(`${BASE_URL5}/upsert-hierarchy`, resolver);
4094
+ }
4063
4095
  return {
4064
- getAllTradingPartners
4096
+ getAllTradingPartners,
4097
+ upsertRelationship,
4098
+ upsertHierarchy
4065
4099
  };
4066
4100
  }
4067
4101
 
package/dist/msw.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as msw from 'msw';
2
2
  import { ResponseResolver, RestRequest, RestContext, DefaultBodyType } from 'msw';
3
3
  import * as msw_lib_glossary_de6278a9 from 'msw/lib/glossary-de6278a9';
4
- import { A as AsstClient, I as ImportErrors, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, c as ItemCategoriesSearch, E as Export, d as attrProdTypeSchema, T as TradingPartnerAccessByCompanyId, U as UserAccount, e as ItemErrorDetailsResult, L as Locale, f as ItemSearchView, g as ItemDetailView, h as AttributeMetaData, i as AttributesByCompany, j as AttributeDefinition, k as AttributeValidValues, S as SpreadsheetTemplate } from './CompanyBriefByOrg-f1bfabb3.js';
4
+ import { A as AsstClient, I as ImportErrors, a as Import, b as ImportsStatus, V as VendorPartnerAttGroups, c as ItemCategoriesSearch, E as Export, d as attrProdTypeSchema, T as TradingPartnerAccessByCompanyId, e as CompanyRelationshipUpsertBody, U as UserAccount, f as ItemErrorDetailsResult, L as Locale, g as ItemSearchView, h as ItemDetailView, i as AttributeMetaData, j as AttributesByCompany, k as AttributeDefinition, l as AttributeValidValues, S as SpreadsheetTemplate } from './CompanyBriefByOrg-eea5479d.js';
5
5
  import { z } from 'zod';
6
- import { I as ItemStatusResponse } from './index-d94fdfef.js';
7
- export { c as createCompaniesApi } from './index-d94fdfef.js';
6
+ import { I as ItemStatusResponse } from './index-ba0dd228.js';
7
+ export { c as createCompaniesApi } from './index-ba0dd228.js';
8
8
  import 'ky-universal';
9
9
  import 'ky';
10
10
 
@@ -185,6 +185,20 @@ declare function createTradingPartnerAccessApiHandlers(client: AsstClient): {
185
185
  }[];
186
186
  };
187
187
  };
188
+ upsertRelationship: {
189
+ (resolver?: ResponseResolver<RestRequest<CompanyRelationshipUpsertBody>, RestContext>): msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
190
+ generateData(): {
191
+ isActive: number;
192
+ createdDate: string;
193
+ catalogId: number;
194
+ modifiedDate: string;
195
+ retailerId: number;
196
+ supplierId: number;
197
+ itemPartnerId: number;
198
+ applications: ("ASSORTMENT" | "ITEM-XREF")[];
199
+ };
200
+ };
201
+ upsertHierarchy: (resolver?: ResponseResolver<RestRequest<CompanyRelationshipUpsertBody>, RestContext>) => msw.RestHandler<msw_lib_glossary_de6278a9.M<msw_lib_glossary_de6278a9.h>>;
188
202
  };
189
203
 
190
204
  /**
package/dist/msw.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  BASE_URL9,
16
16
  BASE_URL_V2,
17
17
  createCompaniesApi
18
- } from "./chunk-FDGLFR7X.js";
18
+ } from "./chunk-HBDHFANT.js";
19
19
  import {
20
20
  attrProdTypeSchema,
21
21
  attributeDefinitionSchema,
@@ -28,6 +28,7 @@ import {
28
28
  itemCategoriesSearchSchema,
29
29
  itemDetailViewSchema,
30
30
  itemErrorDetailsResultSchema,
31
+ itemPartnerSchema,
31
32
  itemSearchViewSchema,
32
33
  itemStatusResponseSchema,
33
34
  localeSchema,
@@ -37,7 +38,7 @@ import {
37
38
  userAccountSchema,
38
39
  vendorPartnerAttGroupsSchema,
39
40
  z
40
- } from "./chunk-PUQDOFRT.js";
41
+ } from "./chunk-VICSFYTR.js";
41
42
 
42
43
  // lib/imports/mockHandlers.ts
43
44
  import { generateMock } from "@anatine/zod-mock";
@@ -190,8 +191,21 @@ function createTradingPartnerAccessApiHandlers(client) {
190
191
  return rest5.get(`${client.getBaseUrl()}${BASE_URL4}/connections`, resolver);
191
192
  }
192
193
  getAllTradingPartners.generateData = () => generateMock4(tradingPartnerAccessByCompanyIdSchema);
194
+ function upsertRelationship(resolver = (_req, res, ctx) => {
195
+ return res(ctx.status(200));
196
+ }) {
197
+ return rest5.post(`${BASE_URL4}/upsert-relationship`, resolver);
198
+ }
199
+ upsertRelationship.generateData = () => generateMock4(itemPartnerSchema);
200
+ function upsertHierarchy(resolver = (_req, res, ctx) => {
201
+ return res(ctx.status(200));
202
+ }) {
203
+ return rest5.post(`${BASE_URL4}/upsert-hierarchy`, resolver);
204
+ }
193
205
  return {
194
- getAllTradingPartners
206
+ getAllTradingPartners,
207
+ upsertRelationship,
208
+ upsertHierarchy
195
209
  };
196
210
  }
197
211
 
@@ -1,4 +1,4 @@
1
- import './CompanyBriefByOrg-f1bfabb3.js';
1
+ import './CompanyBriefByOrg-eea5479d.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const importDetailSchema: z.ZodObject<{
@@ -112,6 +112,36 @@ declare const connectionSchema: z.ZodObject<{
112
112
  }>;
113
113
  type Connection = z.infer<typeof connectionSchema>;
114
114
 
115
+ declare const itemPartnerSchema: z.ZodObject<{
116
+ itemPartnerId: z.ZodNumber;
117
+ retailerId: z.ZodNumber;
118
+ supplierId: z.ZodNumber;
119
+ catalogId: z.ZodNumber;
120
+ isActive: z.ZodNumber;
121
+ createdDate: z.ZodString;
122
+ modifiedDate: z.ZodString;
123
+ applications: z.ZodArray<z.ZodEnum<["ASSORTMENT", "ITEM-XREF"]>, "many">;
124
+ }, "strip", z.ZodTypeAny, {
125
+ isActive: number;
126
+ createdDate: string;
127
+ modifiedDate: string;
128
+ retailerId: number;
129
+ supplierId: number;
130
+ catalogId: number;
131
+ itemPartnerId: number;
132
+ applications: ("ASSORTMENT" | "ITEM-XREF")[];
133
+ }, {
134
+ isActive: number;
135
+ createdDate: string;
136
+ modifiedDate: string;
137
+ retailerId: number;
138
+ supplierId: number;
139
+ catalogId: number;
140
+ itemPartnerId: number;
141
+ applications: ("ASSORTMENT" | "ITEM-XREF")[];
142
+ }>;
143
+ type ItemPartner = z.infer<typeof itemPartnerSchema>;
144
+
115
145
  declare const baseHierarchySchema: z.ZodObject<{
116
146
  id: z.ZodString;
117
147
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -3270,4 +3300,4 @@ declare const itemErrorDetailsSchema: z.ZodObject<{
3270
3300
  }>;
3271
3301
  type ItemErrorDetails = z.infer<typeof itemErrorDetailsSchema>;
3272
3302
 
3273
- export { downLoadItemsParamsSchema as $, AttributeSummary as A, HierarchyDetails as B, Connection as C, DownLoadItemsParams as D, ExportDayOfWeek as E, ItemPrice as F, GenerateImportTemplateParams as G, Hierarchy as H, ItemHierarchyResponse as I, PackComponentDetails as J, Bulb as K, PackComponent as L, MediaItem as M, RepeatableGroup as N, PackComponentItemInfo as O, PhaseEnum as P, ItemErrorDetails as Q, RegisteredService as R, SpsItemIdResponse as S, TradingPartnerStage as T, importDetailSchema as U, importErrorSchema as V, importStatusEnumSchema as W, generateImportTemplateParamsSchema as X, exportDayOfWeekEnum as Y, exportFrequencyEnum as Z, exportTypeEnum as _, ItemDetail as a, itemCategorySchema as a0, hierarchySchema as a1, itemHierarchyResponseSchema as a2, itemHierarchySchema as a3, attrDatatypeNameEnumSchema as a4, attributeGroupSchema as a5, attributeSummarySchema as a6, itemHeaderSchema as a7, itemMapSchema as a8, itemTableSchema as a9, registeredServiceSchema as aA, itemErrorDetailsSchema as aB, phaseEnumSchema as aa, tradingPartnerStageSchema as ab, bulbSchema as ac, itemPriceSchema as ad, mediaItemSchema as ae, itemDetailSchema as af, groupedItemSchema as ag, categoryEnumSchema as ah, packComponentSchema as ai, attributeDetailSchema as aj, repeatableGroupSchema as ak, componentDetailsSchema as al, hierarchyDetailsSchema as am, groupedAttributesSchema as an, hierarchyCategorySchema as ao, groupedAttributeListSchema as ap, packComponentDetailsSchema as aq, packComponentItemInfoSchema as ar, spsItemIdResponseSchema as as, spreadsheetTemplateCompanySchema as at, connectionSchema as au, identityServiceDatetimePreferencesSchema as av, identityServiceOrganizationMetadataSchema as aw, identityServiceOrganizationSchema as ax, identityServicePreferencesSchema as ay, identityServiceUserSchema as az, ImportDetails as b, ImportError as c, ImportStatusEnum as d, ExportFrequency as e, ExportType as f, ItemCategory as g, ItemHierarchy as h, AttrDatatypeNameEnum as i, AttributeGroup as j, SpreadsheetTemplateCompany as k, IdentityServiceOrganizationMetadata as l, IdentityServiceDatetimePreferences as m, IdentityServiceOrganization as n, IdentityServicePreferences as o, IdentityServiceUser as p, ItemHeader as q, ItemMap as r, ItemTable as s, AttributeDetail as t, CategoryEnum as u, ComponentDetails as v, GroupedAttributeList as w, GroupedAttributes as x, GroupedItem as y, HierarchyCategory as z };
3303
+ export { exportTypeEnum as $, AttributeSummary as A, HierarchyCategory as B, Connection as C, DownLoadItemsParams as D, ExportDayOfWeek as E, HierarchyDetails as F, GenerateImportTemplateParams as G, Hierarchy as H, ItemPartner as I, ItemPrice as J, PackComponentDetails as K, Bulb as L, MediaItem as M, PackComponent as N, RepeatableGroup as O, PhaseEnum as P, PackComponentItemInfo as Q, RegisteredService as R, SpsItemIdResponse as S, TradingPartnerStage as T, ItemErrorDetails as U, importDetailSchema as V, importErrorSchema as W, importStatusEnumSchema as X, generateImportTemplateParamsSchema as Y, exportDayOfWeekEnum as Z, exportFrequencyEnum as _, ItemHierarchyResponse as a, downLoadItemsParamsSchema as a0, itemCategorySchema as a1, hierarchySchema as a2, itemHierarchyResponseSchema as a3, itemHierarchySchema as a4, attrDatatypeNameEnumSchema as a5, attributeGroupSchema as a6, attributeSummarySchema as a7, itemHeaderSchema as a8, itemMapSchema as a9, identityServicePreferencesSchema as aA, identityServiceUserSchema as aB, registeredServiceSchema as aC, itemErrorDetailsSchema as aD, itemTableSchema as aa, phaseEnumSchema as ab, tradingPartnerStageSchema as ac, bulbSchema as ad, itemPriceSchema as ae, mediaItemSchema as af, itemDetailSchema as ag, groupedItemSchema as ah, categoryEnumSchema as ai, packComponentSchema as aj, attributeDetailSchema as ak, repeatableGroupSchema as al, componentDetailsSchema as am, hierarchyDetailsSchema as an, groupedAttributesSchema as ao, hierarchyCategorySchema as ap, groupedAttributeListSchema as aq, packComponentDetailsSchema as ar, packComponentItemInfoSchema as as, spsItemIdResponseSchema as at, spreadsheetTemplateCompanySchema as au, connectionSchema as av, itemPartnerSchema as aw, identityServiceDatetimePreferencesSchema as ax, identityServiceOrganizationMetadataSchema as ay, identityServiceOrganizationSchema as az, ItemDetail as b, ImportDetails as c, ImportError as d, ImportStatusEnum as e, ExportFrequency as f, ExportType as g, ItemCategory as h, ItemHierarchy as i, AttrDatatypeNameEnum as j, AttributeGroup as k, SpreadsheetTemplateCompany as l, IdentityServiceOrganizationMetadata as m, IdentityServiceDatetimePreferences as n, IdentityServiceOrganization as o, IdentityServicePreferences as p, IdentityServiceUser as q, ItemHeader as r, ItemMap as s, ItemTable as t, AttributeDetail as u, CategoryEnum as v, ComponentDetails as w, GroupedAttributeList as x, GroupedAttributes as y, GroupedItem as z };
package/dist/zod.cjs CHANGED
@@ -42,6 +42,7 @@ __export(zod_exports, {
42
42
  bulbSchema: () => bulbSchema,
43
43
  categoryEnumSchema: () => categoryEnumSchema,
44
44
  companyBriefByOrgSchema: () => companyBriefByOrgSchema,
45
+ companyRelationshipUpsertBodySchema: () => companyRelationshipUpsertBodySchema,
45
46
  componentDetailsSchema: () => componentDetailsSchema,
46
47
  connectionSchema: () => connectionSchema,
47
48
  downLoadItemsParamsSchema: () => downLoadItemsParamsSchema,
@@ -78,6 +79,7 @@ __export(zod_exports, {
78
79
  itemHierarchyResponseSchema: () => itemHierarchyResponseSchema,
79
80
  itemHierarchySchema: () => itemHierarchySchema,
80
81
  itemMapSchema: () => itemMapSchema,
82
+ itemPartnerSchema: () => itemPartnerSchema,
81
83
  itemPriceSchema: () => itemPriceSchema,
82
84
  itemSearchViewSchema: () => itemSearchViewSchema,
83
85
  itemTableSchema: () => itemTableSchema,
@@ -4478,6 +4480,27 @@ var connectionSchema = z.object({
4478
4480
  partner_org_id: z.string()
4479
4481
  });
4480
4482
 
4483
+ // lib/tradingPartners/models/CompanyRelationshipUpsertBody.ts
4484
+ var companyRelationshipUpsertBodySchema = z.object({
4485
+ supplierId: z.number(),
4486
+ retailerId: z.number(),
4487
+ catalogId: z.number(),
4488
+ isActive: z.boolean(),
4489
+ applicationType: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"])).default([])
4490
+ });
4491
+
4492
+ // lib/tradingPartners/models/ItemPartner.ts
4493
+ var itemPartnerSchema = z.object({
4494
+ itemPartnerId: z.number(),
4495
+ retailerId: z.number(),
4496
+ supplierId: z.number(),
4497
+ catalogId: z.number(),
4498
+ isActive: z.number(),
4499
+ createdDate: z.string(),
4500
+ modifiedDate: z.string(),
4501
+ applications: z.array(z.enum(["ASSORTMENT", "ITEM-XREF"]))
4502
+ });
4503
+
4481
4504
  // lib/tradingPartners/models/TradingPartnerAccessByCompanyId.ts
4482
4505
  var tradingPartnerAccessByCompanyIdSchema = z.object({
4483
4506
  companyId: z.number(),
@@ -4629,6 +4652,7 @@ var companyBriefByOrgSchema = z.object({
4629
4652
  bulbSchema,
4630
4653
  categoryEnumSchema,
4631
4654
  companyBriefByOrgSchema,
4655
+ companyRelationshipUpsertBodySchema,
4632
4656
  componentDetailsSchema,
4633
4657
  connectionSchema,
4634
4658
  downLoadItemsParamsSchema,
@@ -4665,6 +4689,7 @@ var companyBriefByOrgSchema = z.object({
4665
4689
  itemHierarchyResponseSchema,
4666
4690
  itemHierarchySchema,
4667
4691
  itemMapSchema,
4692
+ itemPartnerSchema,
4668
4693
  itemPriceSchema,
4669
4694
  itemSearchViewSchema,
4670
4695
  itemTableSchema,
package/dist/zod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { d as attrProdTypeSchema, w as attributeDefinitionSchema, x as attributeMetaDataSchema, z as attributeValidValuesSchema, y as attributesByCompanySchema, N as companyBriefByOrgSchema, p as envSchema, t as exportSchema, q as importErrorsSchema, r as importSchema, s as importsStatusSchema, u as itemCategoriesSearchSchema, F as itemDetailViewSchema, M as itemErrorDetailsResultSchema, D as itemSearchViewSchema, G as localeSchema, H as spreadsheetTemplateSchema, J as tradingPartnerAccessByCompanyIdSchema, K as userAccountSchema, v as vendorPartnerAttGroupsSchema } from './CompanyBriefByOrg-f1bfabb3.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, $ as downLoadItemsParamsSchema, Y as exportDayOfWeekEnum, Z as exportFrequencyEnum, _ as exportTypeEnum, X as generateImportTemplateParamsSchema, ap as groupedAttributeListSchema, an as groupedAttributesSchema, ag as groupedItemSchema, ao as hierarchyCategorySchema, am as hierarchyDetailsSchema, a1 as hierarchySchema, av as identityServiceDatetimePreferencesSchema, aw as identityServiceOrganizationMetadataSchema, ax as identityServiceOrganizationSchema, ay as identityServicePreferencesSchema, az as identityServiceUserSchema, U as importDetailSchema, V as importErrorSchema, W as importStatusEnumSchema, a0 as itemCategorySchema, af as itemDetailSchema, aB as itemErrorDetailsSchema, a7 as itemHeaderSchema, a2 as itemHierarchyResponseSchema, a3 as itemHierarchySchema, a8 as itemMapSchema, ad as itemPriceSchema, a9 as itemTableSchema, ae as mediaItemSchema, aq as packComponentDetailsSchema, ar as packComponentItemInfoSchema, ai as packComponentSchema, aa as phaseEnumSchema, aA as registeredServiceSchema, ak as repeatableGroupSchema, at as spreadsheetTemplateCompanySchema, as as spsItemIdResponseSchema, ab as tradingPartnerStageSchema } from './zod-ec1cdb27.js';
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-eea5479d.js';
2
+ export { a5 as attrDatatypeNameEnumSchema, ak as attributeDetailSchema, a6 as attributeGroupSchema, a7 as attributeSummarySchema, ad as bulbSchema, ai as categoryEnumSchema, am as componentDetailsSchema, av as connectionSchema, a0 as downLoadItemsParamsSchema, Z as exportDayOfWeekEnum, _ as exportFrequencyEnum, $ as exportTypeEnum, Y as generateImportTemplateParamsSchema, aq as groupedAttributeListSchema, ao as groupedAttributesSchema, ah as groupedItemSchema, ap as hierarchyCategorySchema, an as hierarchyDetailsSchema, a2 as hierarchySchema, ax as identityServiceDatetimePreferencesSchema, ay as identityServiceOrganizationMetadataSchema, az as identityServiceOrganizationSchema, aA as identityServicePreferencesSchema, aB as identityServiceUserSchema, V as importDetailSchema, W as importErrorSchema, X as importStatusEnumSchema, a1 as itemCategorySchema, ag as itemDetailSchema, aD as itemErrorDetailsSchema, a8 as itemHeaderSchema, a3 as itemHierarchyResponseSchema, a4 as itemHierarchySchema, a9 as itemMapSchema, aw as itemPartnerSchema, ae as itemPriceSchema, aa as itemTableSchema, af as mediaItemSchema, ar as packComponentDetailsSchema, as as packComponentItemInfoSchema, aj as packComponentSchema, ab as phaseEnumSchema, aC as registeredServiceSchema, al as repeatableGroupSchema, au as spreadsheetTemplateCompanySchema, at as spsItemIdResponseSchema, ac as tradingPartnerStageSchema } from './zod-5a9153f1.js';
3
3
  import 'ky-universal';
4
4
  import 'ky';
5
5
  import 'zod';
package/dist/zod.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  bulbSchema,
12
12
  categoryEnumSchema,
13
13
  companyBriefByOrgSchema,
14
+ companyRelationshipUpsertBodySchema,
14
15
  componentDetailsSchema,
15
16
  connectionSchema,
16
17
  downLoadItemsParamsSchema,
@@ -47,6 +48,7 @@ import {
47
48
  itemHierarchyResponseSchema,
48
49
  itemHierarchySchema,
49
50
  itemMapSchema,
51
+ itemPartnerSchema,
50
52
  itemPriceSchema,
51
53
  itemSearchViewSchema,
52
54
  itemTableSchema,
@@ -65,7 +67,7 @@ import {
65
67
  tradingPartnerStageSchema,
66
68
  userAccountSchema,
67
69
  vendorPartnerAttGroupsSchema
68
- } from "./chunk-PUQDOFRT.js";
70
+ } from "./chunk-VICSFYTR.js";
69
71
  export {
70
72
  attrDatatypeNameEnumSchema,
71
73
  attrProdTypeSchema,
@@ -79,6 +81,7 @@ export {
79
81
  bulbSchema,
80
82
  categoryEnumSchema,
81
83
  companyBriefByOrgSchema,
84
+ companyRelationshipUpsertBodySchema,
82
85
  componentDetailsSchema,
83
86
  connectionSchema,
84
87
  downLoadItemsParamsSchema,
@@ -115,6 +118,7 @@ export {
115
118
  itemHierarchyResponseSchema,
116
119
  itemHierarchySchema,
117
120
  itemMapSchema,
121
+ itemPartnerSchema,
118
122
  itemPriceSchema,
119
123
  itemSearchViewSchema,
120
124
  itemTableSchema,
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": "0.1.0",
6
+ "version": "0.2.0",
7
7
  "files": [
8
8
  "dist"
9
9
  ],