@code.store/arcxp-sdk-ts 4.9.0 → 4.11.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.
@@ -1,7 +1,9 @@
1
1
  import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
2
- import { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse } from './types';
2
+ import { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse, UserProfile } from './types';
3
3
  export declare class ArcIdentity extends ArcAbstractAPI {
4
4
  constructor(options: ArcAPIOptions);
5
5
  migrateBatch(payload: MigrateBatchUsersPayload): Promise<MigrateBatchUsersResponse>;
6
6
  getUser(id: string): Promise<GetUserResponse>;
7
+ getUserByEmail(email: string): Promise<GetUserResponse>;
8
+ updateUserProfile(id: string, payload: Partial<UserProfile>): Promise<UserProfile>;
7
9
  }
@@ -14,6 +14,14 @@ class ArcIdentity extends abstract_api_1.ArcAbstractAPI {
14
14
  const { data } = await this.client.get(`/user?search=uuid=${id}`);
15
15
  return data;
16
16
  }
17
+ async getUserByEmail(email) {
18
+ const { data } = await this.client.get(`/user?search=email=${email}`);
19
+ return data;
20
+ }
21
+ async updateUserProfile(id, payload) {
22
+ const { data } = await this.client.patch(`/profile/${id}`, payload);
23
+ return data;
24
+ }
17
25
  }
18
26
  exports.ArcIdentity = ArcIdentity;
19
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/identity/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;AAGhE,MAAa,WAAY,SAAQ,6BAAc;IAC7C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAiC;QAClD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC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AEpE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5BD,kCA4BC"}
@@ -1,10 +1,5 @@
1
- export type MigrateIdentityCustomAttributeType = {
2
- name: string;
3
- value: string;
4
- type: 'String' | 'Number' | 'Date' | 'Boolean';
5
- };
6
1
  export type MigrateUserPayload = {
7
- identities: UserIdentity[];
2
+ identities: IdentityRequestMigration[];
8
3
  profile: UserProfile;
9
4
  uuid?: string;
10
5
  };
@@ -37,6 +32,25 @@ export type GetUserResponse = {
37
32
  profile: UserProfile;
38
33
  }[];
39
34
  };
35
+ export interface IdentityRequestMigration {
36
+ /**
37
+ * The login username for this user
38
+ * userName can be set up equal to email
39
+ * @minLength 5
40
+ * @maxLength 100
41
+ * @example "john.doe@donotreply.com"
42
+ */
43
+ userName: string;
44
+ credentials: string;
45
+ /** The grantType of this request */
46
+ grantType?: 'password' | 'facebook' | 'google' | 'apple';
47
+ /**
48
+ * The date the user last logged on for this identity, Timestamp in milliseconds.
49
+ * @format date-time
50
+ * @example "1680779480000"
51
+ */
52
+ lastLoginDate?: string;
53
+ }
40
54
  export interface UserIdentity {
41
55
  /**
42
56
  * Format: date-time
@@ -183,9 +197,9 @@ export interface UserAddress {
183
197
  line1?: string;
184
198
  line2: string;
185
199
  locality: string;
186
- region: string;
187
- postal: string;
188
- country: string;
200
+ region?: string;
201
+ postal?: string;
202
+ country?: string;
189
203
  /**
190
204
  * @description Type of address
191
205
  * @example WORK, HOME, PRIMARY, OTHER
@@ -3,4 +3,5 @@ import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
3
3
  export declare class ArcProtoCenter extends ArcAbstractAPI {
4
4
  constructor(options: ArcAPIOptions);
5
5
  getImageDataById(photoId: string): Promise<AnImage>;
6
+ uploadImageANS(image: AnImage): Promise<AnImage>;
6
7
  }
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.ArcProtoCenter = void 0;
7
+ const form_data_1 = __importDefault(require("form-data"));
4
8
  const abstract_api_1 = require("../abstract-api");
5
9
  class ArcProtoCenter extends abstract_api_1.ArcAbstractAPI {
6
10
  constructor(options) {
@@ -10,6 +14,15 @@ class ArcProtoCenter extends abstract_api_1.ArcAbstractAPI {
10
14
  const { data } = await this.client.get(`/v2/photos/${photoId}`);
11
15
  return data;
12
16
  }
17
+ async uploadImageANS(image) {
18
+ const form = new form_data_1.default();
19
+ form.append('ans', JSON.stringify(image), {
20
+ filename: 'ans.json',
21
+ contentType: 'application/json',
22
+ });
23
+ const { data } = await this.client.post(`/v2/photos`, form, { headers: form.getHeaders() });
24
+ return data;
25
+ }
13
26
  }
14
27
  exports.ArcProtoCenter = ArcProtoCenter;
15
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/photo-center/index.ts"],"names":[],"mappings":";;;AACA,kDAAgE;AAEhE,MAAa,cAAe,SAAQ,6BAAc;IAChD,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9C,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,OAAe;QACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AARD,wCAQC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/photo-center/index.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AAEjC,kDAAgE;AAEhE,MAAa,cAAe,SAAQ,6BAAc;IAChD,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9C,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,OAAe;QACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,KAAc;QACjC,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YACxC,QAAQ,EAAE,UAAU;YACpB,WAAW,EAAE,kBAAkB;SAChC,CAAC,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,YAAY,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACrG,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlBD,wCAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code.store/arcxp-sdk-ts",
3
- "version": "4.9.0",
3
+ "version": "4.11.0",
4
4
  "description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,8 @@
17
17
  "lint": "tsc --noEmit && TIMING=1 eslint \"src/**/*.ts*\"",
18
18
  "test": "vitest",
19
19
  "gen:ts": "npx ts-node-dev ./src/scripts/json-schema-to-ts.ts",
20
- "cs": "npx changeset && npx changeset version"
20
+ "cs": "npx changeset && npx changeset version",
21
+ "swaggerToTypes": "npx swagger-typescript-api -p ./tmp/swagger.json -o ./tmp -n swaggerTypes.ts"
21
22
  },
22
23
  "keywords": [
23
24
  "ArcXP",