@deliverart/sdk-js-company 0.1.2 → 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/package.json CHANGED
@@ -1,47 +1,32 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-company",
3
- "description": "Deliverart JavaScript SDK for User Management",
4
- "version": "0.1.2",
3
+ "description": "Deliverart JavaScript SDK for Company Management",
4
+ "version": "1.1.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "tsup": {
9
+ "tsconfig": "./tsconfig.json"
10
+ },
8
11
  "exports": {
9
12
  ".": {
10
13
  "import": "./dist/index.js",
11
14
  "require": "./dist/index.cjs"
12
15
  }
13
16
  },
17
+ "files": [
18
+ "dist"
19
+ ],
14
20
  "dependencies": {
15
- "@deliverart/sdk-js-core": "0.2.0",
16
- "@deliverart/sdk-js-global-types": "0.0.17",
17
- "@deliverart/sdk-js-user": "0.3.0",
18
- "axios": "1.9.0",
19
- "zod": "3.25.67"
20
- },
21
- "devDependencies": {
22
- "@changesets/cli": "^2.29.4",
23
- "@eslint/js": "9.28.0",
24
- "@types/node": "22.15.30",
25
- "@typescript-eslint/eslint-plugin": "8.33.1",
26
- "@typescript-eslint/parser": "8.33.1",
27
- "eslint": "9.28.0",
28
- "eslint-config-prettier": "10.1.5",
29
- "eslint-plugin-simple-import-sort": "12.1.1",
30
- "prettier": "3.5.3",
31
- "tsup": "8.5.0",
32
- "typescript": "5.8.3"
21
+ "@deliverart/sdk-js-core": "1.1.0",
22
+ "@deliverart/sdk-js-user": "1.1.0",
23
+ "@deliverart/sdk-js-global-types": "1.1.0"
33
24
  },
34
25
  "publishConfig": {
35
26
  "access": "public"
36
27
  },
37
28
  "scripts": {
38
29
  "build": "tsup src/index.ts --dts --format esm,cjs",
39
- "dev": "tsup src/index.ts --dts --watch",
40
- "lint": "eslint .",
41
- "lint:fix": "eslint . --fix",
42
- "prettier": "prettier --check .",
43
- "prettier:fix": "prettier --write .",
44
- "version": "@changesets/cli version",
45
- "release": "@changesets/cli publish"
30
+ "dev": "tsup src/index.ts --dts --watch"
46
31
  }
47
32
  }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,47 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: write
10
-
11
- jobs:
12
- release:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - uses: pnpm/action-setup@v2
18
- with:
19
- version: 8
20
-
21
- - uses: actions/setup-node@v4
22
- with:
23
- node-version: '20'
24
- registry-url: 'https://registry.npmjs.org'
25
- always-auth: true
26
- env:
27
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28
-
29
- - name: Install deps
30
- run: pnpm install
31
-
32
- - name: Build
33
- run: pnpm build
34
-
35
- - name: Create version and changelog
36
- run: pnpx @changesets/cli version
37
-
38
- - name: Publish to NPM
39
- run: pnpx @changesets/cli publish
40
- env:
41
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42
-
43
- - name: Push updated versions and changelogs
44
- uses: EndBug/add-and-commit@v9
45
- with:
46
- message: 'chore(release): version bump'
47
- add: '.'
package/.prettierrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "printWidth": 100,
5
- "trailingComma": "all",
6
- "arrowParens": "avoid"
7
- }
package/CHANGELOG.md DELETED
@@ -1,61 +0,0 @@
1
- # @deliverart/sdk-js-company
2
-
3
- ## 0.1.2
4
-
5
- ### Patch Changes
6
-
7
- - 575341f: expose adminby for editable field
8
-
9
- ## 0.1.1
10
-
11
- ### Patch Changes
12
-
13
- - f1dee79: fix taxCode nullable
14
-
15
- ## 0.1.0
16
-
17
- ### Minor Changes
18
-
19
- - 84e283d: update logic based on new sdk core version
20
-
21
- ## 0.0.8
22
-
23
- ### Patch Changes
24
-
25
- - 16b47bd: encrease version pkg
26
-
27
- ## 0.0.7
28
-
29
- ### Patch Changes
30
-
31
- - b8d802e: update dependencise
32
-
33
- ## 0.0.6
34
-
35
- ### Patch Changes
36
-
37
- - 65b64b5: Expose types
38
-
39
- ## 0.0.5
40
-
41
- ### Patch Changes
42
-
43
- - 83e0325: Expose company path types
44
-
45
- ## 0.0.4
46
-
47
- ### Patch Changes
48
-
49
- - 36a941d: Upgrade types version
50
-
51
- ## 0.0.3
52
-
53
- ### Patch Changes
54
-
55
- - b4fc2d4: Upgrade types version
56
-
57
- ## 0.0.2
58
-
59
- ### Patch Changes
60
-
61
- - a9d7757: Upgrade types version
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # sdk-js-company
2
-
3
- Company module for SDK
package/dist/index.cjs DELETED
@@ -1,230 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- CreateCompany: () => CreateCompany,
24
- DeleteCompany: () => DeleteCompany,
25
- GetCompanies: () => GetCompanies,
26
- GetCompanyDetails: () => GetCompanyDetails,
27
- UpdateCompany: () => UpdateCompany,
28
- companiesQuerySchema: () => companiesQuerySchema,
29
- companyDetailsSchema: () => companyDetailsSchema,
30
- companyIriSchema: () => companyIriSchema,
31
- companySchema: () => companySchema,
32
- createCompanyInputSchema: () => createCompanyInputSchema,
33
- createCompanyResponseSchema: () => createCompanyResponseSchema,
34
- deleteCompanyInputSchema: () => deleteCompanyInputSchema,
35
- deleteCompanyResponseSchema: () => deleteCompanyResponseSchema,
36
- getCompaniesInputSchema: () => getCompaniesInputSchema,
37
- getCompaniesQuerySchema: () => getCompaniesQuerySchema,
38
- getCompaniesResponseSchema: () => getCompaniesResponseSchema,
39
- getCompanyDetailsInputSchema: () => getCompanyDetailsInputSchema,
40
- getCompanyDetailsResponseSchema: () => getCompanyDetailsResponseSchema,
41
- updateCompanyInputSchema: () => updateCompanyInputSchema,
42
- updateCompanyResponseSchema: () => updateCompanyResponseSchema,
43
- writableCompanySchema: () => writableCompanySchema
44
- });
45
- module.exports = __toCommonJS(index_exports);
46
-
47
- // src/models.ts
48
- var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
49
- var import_sdk_js_user = require("@deliverart/sdk-js-user");
50
- var import_zod = require("zod");
51
- var companySchema = import_zod.z.object({
52
- id: import_zod.z.string(),
53
- businessName: import_zod.z.string(),
54
- vat: import_zod.z.string(),
55
- taxCode: import_zod.z.string().nullable(),
56
- operationalAddress: import_sdk_js_global_types.addressSchema,
57
- createdAt: import_sdk_js_global_types.datetimeSchema,
58
- updatedAt: import_sdk_js_global_types.datetimeSchema
59
- });
60
- var companyDetailsSchema = companySchema.extend({
61
- billingAddress: import_sdk_js_global_types.addressSchema,
62
- billingData: import_sdk_js_global_types.billingDataSchema,
63
- adminBy: import_sdk_js_user.userIriSchema
64
- });
65
- var writableCompanySchema = companyDetailsSchema.pick({
66
- businessName: true,
67
- vat: true,
68
- taxCode: true,
69
- billingAddress: true,
70
- operationalAddress: true,
71
- billingData: true,
72
- adminBy: true
73
- // Only Admin can set this
74
- });
75
- var companiesQuerySchema = import_zod.z.object({
76
- businessName: import_zod.z.string().optional(),
77
- vat: import_zod.z.string().optional(),
78
- taxCode: import_zod.z.string().optional(),
79
- "billingAddress.city": import_zod.z.string().optional(),
80
- "billingAddress.postalCode": import_zod.z.string().optional(),
81
- "operationalAddress.city": import_zod.z.string().optional(),
82
- "operationalAddress.postalCode": import_zod.z.string().optional(),
83
- "order[businessName]": import_sdk_js_global_types.sortDirSchema.optional(),
84
- "order[createdAt]": import_sdk_js_global_types.sortDirSchema.optional(),
85
- "order[updatedAt]": import_sdk_js_global_types.sortDirSchema.optional(),
86
- page: import_zod.z.coerce.number().optional()
87
- });
88
-
89
- // src/requests/CreateCompany.ts
90
- var import_sdk_js_core = require("@deliverart/sdk-js-core");
91
- var createCompanyInputSchema = writableCompanySchema.required();
92
- var createCompanyResponseSchema = companyDetailsSchema;
93
- var CreateCompany = class extends import_sdk_js_core.AbstractApiRequest {
94
- method = "POST";
95
- contentType = "application/json";
96
- accept = "application/json";
97
- inputSchema = createCompanyInputSchema;
98
- outputSchema = createCompanyResponseSchema;
99
- querySchema = void 0;
100
- headersSchema = void 0;
101
- constructor(input) {
102
- super(input);
103
- }
104
- getPath() {
105
- return "/companies";
106
- }
107
- };
108
-
109
- // src/requests/DeleteCompany.ts
110
- var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
111
- var import_zod2 = require("zod");
112
- var deleteCompanyInputSchema = import_zod2.z.undefined();
113
- var deleteCompanyResponseSchema = import_zod2.z.undefined();
114
- var DeleteCompany = class extends import_sdk_js_core2.AbstractApiRequest {
115
- method = "DELETE";
116
- contentType = "application/json";
117
- accept = "application/json";
118
- inputSchema = deleteCompanyInputSchema;
119
- outputSchema = deleteCompanyResponseSchema;
120
- querySchema = void 0;
121
- headersSchema = void 0;
122
- companyId;
123
- constructor(companyId) {
124
- super(void 0);
125
- this.companyId = companyId;
126
- }
127
- getPath() {
128
- return `/companies/${this.companyId}`;
129
- }
130
- };
131
-
132
- // src/requests/GetCompanies.ts
133
- var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
134
- var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
135
- var import_zod3 = require("zod");
136
- var getCompaniesQuerySchema = companiesQuerySchema;
137
- var getCompaniesInputSchema = import_zod3.z.undefined();
138
- var getCompaniesResponseSchema = (0, import_sdk_js_global_types2.createPaginatedSchema)(companySchema);
139
- var GetCompanies = class extends import_sdk_js_core3.AbstractApiRequest {
140
- method = "GET";
141
- contentType = "application/json";
142
- accept = "application/json";
143
- inputSchema = getCompaniesInputSchema;
144
- outputSchema = getCompaniesResponseSchema;
145
- querySchema = getCompaniesQuerySchema;
146
- headersSchema = void 0;
147
- constructor(options) {
148
- super(void 0, options);
149
- }
150
- getPath() {
151
- return "/companies";
152
- }
153
- parseResponse(data, rawResponse) {
154
- const companies = import_zod3.z.array(companySchema).parse(data);
155
- return this.validateOutput({ data: companies, pagination: (0, import_sdk_js_global_types2.responseToPagination)(rawResponse) });
156
- }
157
- };
158
-
159
- // src/requests/GetCompanyDetails.ts
160
- var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
161
- var import_zod4 = require("zod");
162
- var getCompanyDetailsInputSchema = import_zod4.z.undefined();
163
- var getCompanyDetailsResponseSchema = companyDetailsSchema;
164
- var GetCompanyDetails = class extends import_sdk_js_core4.AbstractApiRequest {
165
- method = "GET";
166
- contentType = "application/json";
167
- accept = "application/json";
168
- inputSchema = getCompanyDetailsInputSchema;
169
- outputSchema = getCompanyDetailsResponseSchema;
170
- querySchema = void 0;
171
- headersSchema = void 0;
172
- companyId;
173
- constructor(companyId) {
174
- super(void 0);
175
- this.companyId = companyId;
176
- }
177
- getPath() {
178
- return `/companies/${this.companyId}`;
179
- }
180
- };
181
-
182
- // src/requests/UpdateCompany.ts
183
- var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
184
- var updateCompanyInputSchema = writableCompanySchema.partial();
185
- var updateCompanyResponseSchema = companyDetailsSchema;
186
- var UpdateCompany = class extends import_sdk_js_core5.AbstractApiRequest {
187
- method = "PATCH";
188
- contentType = "application/merge-patch+json";
189
- accept = "application/json";
190
- inputSchema = updateCompanyInputSchema;
191
- outputSchema = updateCompanyResponseSchema;
192
- querySchema = void 0;
193
- headersSchema = void 0;
194
- companyId;
195
- constructor(companyId, input) {
196
- super(input);
197
- this.companyId = companyId;
198
- }
199
- getPath() {
200
- return `/companies/${this.companyId}`;
201
- }
202
- };
203
-
204
- // src/types.ts
205
- var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
206
- var companyIriSchema = (0, import_sdk_js_global_types3.iriSchema)("/companies/:id");
207
- // Annotate the CommonJS export names for ESM import in node:
208
- 0 && (module.exports = {
209
- CreateCompany,
210
- DeleteCompany,
211
- GetCompanies,
212
- GetCompanyDetails,
213
- UpdateCompany,
214
- companiesQuerySchema,
215
- companyDetailsSchema,
216
- companyIriSchema,
217
- companySchema,
218
- createCompanyInputSchema,
219
- createCompanyResponseSchema,
220
- deleteCompanyInputSchema,
221
- deleteCompanyResponseSchema,
222
- getCompaniesInputSchema,
223
- getCompaniesQuerySchema,
224
- getCompaniesResponseSchema,
225
- getCompanyDetailsInputSchema,
226
- getCompanyDetailsResponseSchema,
227
- updateCompanyInputSchema,
228
- updateCompanyResponseSchema,
229
- writableCompanySchema
230
- });