@oblax/identity 1.0.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.
Files changed (49) hide show
  1. package/dist/addresses.d.ts +52 -0
  2. package/dist/addresses.d.ts.map +1 -0
  3. package/dist/addresses.js +94 -0
  4. package/dist/addresses.js.map +1 -0
  5. package/dist/bank-accounts.d.ts +33 -0
  6. package/dist/bank-accounts.d.ts.map +1 -0
  7. package/dist/bank-accounts.js +53 -0
  8. package/dist/bank-accounts.js.map +1 -0
  9. package/dist/contact-methods.d.ts +41 -0
  10. package/dist/contact-methods.d.ts.map +1 -0
  11. package/dist/contact-methods.js +75 -0
  12. package/dist/contact-methods.js.map +1 -0
  13. package/dist/identity-module.d.ts +45 -0
  14. package/dist/identity-module.d.ts.map +1 -0
  15. package/dist/identity-module.js +43 -0
  16. package/dist/identity-module.js.map +1 -0
  17. package/dist/index.d.ts +51 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +55 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/organization-people.d.ts +26 -0
  22. package/dist/organization-people.d.ts.map +1 -0
  23. package/dist/organization-people.js +31 -0
  24. package/dist/organization-people.js.map +1 -0
  25. package/dist/organizations.d.ts +60 -0
  26. package/dist/organizations.d.ts.map +1 -0
  27. package/dist/organizations.js +144 -0
  28. package/dist/organizations.js.map +1 -0
  29. package/dist/people.d.ts +68 -0
  30. package/dist/people.d.ts.map +1 -0
  31. package/dist/people.js +126 -0
  32. package/dist/people.js.map +1 -0
  33. package/dist/person-organizations.d.ts +26 -0
  34. package/dist/person-organizations.d.ts.map +1 -0
  35. package/dist/person-organizations.js +31 -0
  36. package/dist/person-organizations.js.map +1 -0
  37. package/dist/person-roles.d.ts +39 -0
  38. package/dist/person-roles.d.ts.map +1 -0
  39. package/dist/person-roles.js +48 -0
  40. package/dist/person-roles.js.map +1 -0
  41. package/dist/preferences.d.ts +34 -0
  42. package/dist/preferences.d.ts.map +1 -0
  43. package/dist/preferences.js +68 -0
  44. package/dist/preferences.js.map +1 -0
  45. package/dist/types.d.ts +339 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/dist/types.js +3 -0
  48. package/dist/types.js.map +1 -0
  49. package/package.json +51 -0
@@ -0,0 +1,52 @@
1
+ import type { OblaxContext } from '@oblax/core';
2
+ import type { Address, CreateOrganizationAddressParams, CreatePersonAddressParams, OrganizationAddressIdParams, OrganizationAddressOwnerParams, OwnerKind, PersonAddressIdParams, PersonAddressOwnerParams, UpdateOrganizationAddressParams, UpdatePersonAddressParams } from './types.js';
3
+ /**
4
+ * Manages addresses for a person or an organization.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * // Person address
9
+ * const address = await oblax.identity.people.addresses.create({
10
+ * personId: 'person-id',
11
+ * label: 'Home',
12
+ * country: 'US',
13
+ * city: 'New York',
14
+ * zipcode: '10001',
15
+ * address: '5th Avenue',
16
+ * addressNumber: '1',
17
+ * longitude: -74.006,
18
+ * latitude: 40.7128,
19
+ * })
20
+ *
21
+ * // Organization address
22
+ * await oblax.identity.organizations.addresses.create({
23
+ * organizationId: 'org-id',
24
+ * country: 'US',
25
+ * city: 'San Francisco',
26
+ * zipcode: '94105',
27
+ * address: 'Market St',
28
+ * addressNumber: '100',
29
+ * longitude: -122.4194,
30
+ * latitude: 37.7749,
31
+ * })
32
+ * ```
33
+ */
34
+ export declare class AddressesSubmodule<K extends OwnerKind> {
35
+ private readonly ctx;
36
+ private readonly ownerKind;
37
+ constructor(ctx: OblaxContext, ownerKind: K);
38
+ private basePath;
39
+ /** Creates a new address for the owner. */
40
+ create(params: K extends 'person' ? CreatePersonAddressParams : CreateOrganizationAddressParams): Promise<Address>;
41
+ /** Returns all addresses belonging to the owner. */
42
+ list(params: K extends 'person' ? PersonAddressOwnerParams : OrganizationAddressOwnerParams): Promise<Address[]>;
43
+ /** Fetches a single address by ID. */
44
+ get(params: K extends 'person' ? PersonAddressIdParams : OrganizationAddressIdParams): Promise<Address>;
45
+ /** Replaces an address. Returns `void` (HTTP 204). */
46
+ update(params: K extends 'person' ? UpdatePersonAddressParams : UpdateOrganizationAddressParams): Promise<void>;
47
+ /** Deletes a single address. Returns `void` (HTTP 204). */
48
+ delete(params: K extends 'person' ? PersonAddressIdParams : OrganizationAddressIdParams): Promise<void>;
49
+ /** Deletes all addresses belonging to the owner. Returns `void` (HTTP 204). */
50
+ deleteAll(params: K extends 'person' ? PersonAddressOwnerParams : OrganizationAddressOwnerParams): Promise<void>;
51
+ }
52
+ //# sourceMappingURL=addresses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../src/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EACV,OAAO,EAEP,+BAA+B,EAC/B,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,EAC9B,SAAS,EACT,qBAAqB,EACrB,wBAAwB,EACxB,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,YAAY,CAAA;AA4BnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,kBAAkB,CAAC,CAAC,SAAS,SAAS;IAE/C,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,CAAC;IAG/B,OAAO,CAAC,QAAQ;IAIhB,2CAA2C;IACrC,MAAM,CACV,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,yBAAyB,GAAG,+BAA+B,GACvF,OAAO,CAAC,OAAO,CAAC;IAQnB,oDAAoD;IAC9C,IAAI,CACR,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,wBAAwB,GAAG,8BAA8B,GACrF,OAAO,CAAC,OAAO,EAAE,CAAC;IAKrB,sCAAsC;IAChC,GAAG,CACP,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,qBAAqB,GAAG,2BAA2B,GAC/E,OAAO,CAAC,OAAO,CAAC;IAMnB,sDAAsD;IAChD,MAAM,CACV,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,yBAAyB,GAAG,+BAA+B,GACvF,OAAO,CAAC,IAAI,CAAC;IAShB,2DAA2D;IACrD,MAAM,CACV,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,qBAAqB,GAAG,2BAA2B,GAC/E,OAAO,CAAC,IAAI,CAAC;IAMhB,+EAA+E;IACzE,SAAS,CACb,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,wBAAwB,GAAG,8BAA8B,GACrF,OAAO,CAAC,IAAI,CAAC;CAIjB"}
@@ -0,0 +1,94 @@
1
+ /** Maps camelCase address input to the snake_case wire format. */
2
+ function addressToApi(input) {
3
+ return {
4
+ label: input.label,
5
+ continent: input.continent,
6
+ country: input.country,
7
+ state: input.state,
8
+ city: input.city,
9
+ region: input.region,
10
+ zipcode: input.zipcode,
11
+ address: input.address,
12
+ address_number: input.addressNumber,
13
+ longitude: input.longitude,
14
+ latitude: input.latitude,
15
+ };
16
+ }
17
+ function ownerIdFrom(params) {
18
+ return (params.personId ??
19
+ params.organizationId);
20
+ }
21
+ /**
22
+ * Manages addresses for a person or an organization.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Person address
27
+ * const address = await oblax.identity.people.addresses.create({
28
+ * personId: 'person-id',
29
+ * label: 'Home',
30
+ * country: 'US',
31
+ * city: 'New York',
32
+ * zipcode: '10001',
33
+ * address: '5th Avenue',
34
+ * addressNumber: '1',
35
+ * longitude: -74.006,
36
+ * latitude: 40.7128,
37
+ * })
38
+ *
39
+ * // Organization address
40
+ * await oblax.identity.organizations.addresses.create({
41
+ * organizationId: 'org-id',
42
+ * country: 'US',
43
+ * city: 'San Francisco',
44
+ * zipcode: '94105',
45
+ * address: 'Market St',
46
+ * addressNumber: '100',
47
+ * longitude: -122.4194,
48
+ * latitude: 37.7749,
49
+ * })
50
+ * ```
51
+ */
52
+ export class AddressesSubmodule {
53
+ constructor(ctx, ownerKind) {
54
+ this.ctx = ctx;
55
+ this.ownerKind = ownerKind;
56
+ }
57
+ basePath() {
58
+ return this.ownerKind === 'person' ? '/identity/people' : '/identity/organizations';
59
+ }
60
+ /** Creates a new address for the owner. */
61
+ async create(params) {
62
+ const ownerId = ownerIdFrom(params);
63
+ return this.ctx.http.post(`${this.basePath()}/${ownerId}/addresses`, addressToApi(params));
64
+ }
65
+ /** Returns all addresses belonging to the owner. */
66
+ async list(params) {
67
+ const ownerId = ownerIdFrom(params);
68
+ return this.ctx.http.get(`${this.basePath()}/${ownerId}/addresses`);
69
+ }
70
+ /** Fetches a single address by ID. */
71
+ async get(params) {
72
+ const ownerId = ownerIdFrom(params);
73
+ const addressId = params.addressId;
74
+ return this.ctx.http.get(`${this.basePath()}/${ownerId}/addresses/${addressId}`);
75
+ }
76
+ /** Replaces an address. Returns `void` (HTTP 204). */
77
+ async update(params) {
78
+ const ownerId = ownerIdFrom(params);
79
+ const addressId = params.addressId;
80
+ return this.ctx.http.put(`${this.basePath()}/${ownerId}/addresses/${addressId}`, addressToApi(params));
81
+ }
82
+ /** Deletes a single address. Returns `void` (HTTP 204). */
83
+ async delete(params) {
84
+ const ownerId = ownerIdFrom(params);
85
+ const addressId = params.addressId;
86
+ return this.ctx.http.delete(`${this.basePath()}/${ownerId}/addresses/${addressId}`);
87
+ }
88
+ /** Deletes all addresses belonging to the owner. Returns `void` (HTTP 204). */
89
+ async deleteAll(params) {
90
+ const ownerId = ownerIdFrom(params);
91
+ return this.ctx.http.delete(`${this.basePath()}/${ownerId}/addresses`);
92
+ }
93
+ }
94
+ //# sourceMappingURL=addresses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.js","sourceRoot":"","sources":["../src/addresses.ts"],"names":[],"mappings":"AAeA,kEAAkE;AAClE,SAAS,YAAY,CAAC,KAAmB;IACvC,OAAO;QACL,KAAK,EAAO,KAAK,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AI,OAAO,YAAY,CAAC,CAAA;IAC9E,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import type { OblaxContext } from '@oblax/core';
2
+ import type { BankAccount, BankAccountIdParams, BankAccountOwnerParams, CreateBankAccountParams, UpdateBankAccountParams } from './types.js';
3
+ /**
4
+ * Manages bank accounts for an organization.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const account = await oblax.identity.organizations.bankAccounts.create({
9
+ * organizationId: 'org-id',
10
+ * accountNumber: '123456789',
11
+ * bic: 'BOFAUS3N',
12
+ * iban: 'GB82WEST12345698765432',
13
+ * currency: 'USD',
14
+ * })
15
+ * ```
16
+ */
17
+ export declare class BankAccountsSubmodule {
18
+ private readonly ctx;
19
+ constructor(ctx: OblaxContext);
20
+ /** Creates a new bank account for the organization. */
21
+ create(params: CreateBankAccountParams): Promise<BankAccount>;
22
+ /** Returns all bank accounts belonging to the organization. */
23
+ list(params: BankAccountOwnerParams): Promise<BankAccount[]>;
24
+ /** Fetches a single bank account by ID. */
25
+ get(params: BankAccountIdParams): Promise<BankAccount>;
26
+ /** Replaces a bank account. Returns `void` (HTTP 204). */
27
+ update(params: UpdateBankAccountParams): Promise<void>;
28
+ /** Deletes a single bank account. Returns `void` (HTTP 204). */
29
+ delete(params: BankAccountIdParams): Promise<void>;
30
+ /** Deletes all bank accounts belonging to the organization. Returns `void` (HTTP 204). */
31
+ deleteAll(params: BankAccountOwnerParams): Promise<void>;
32
+ }
33
+ //# sourceMappingURL=bank-accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank-accounts.d.ts","sourceRoot":"","sources":["../src/bank-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,YAAY,CAAA;AAYnB;;;;;;;;;;;;;GAaG;AACH,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,YAAY;IAE9C,uDAAuD;IACjD,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;IAOnE,+DAA+D;IACzD,IAAI,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAMlE,2CAA2C;IACrC,GAAG,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM5D,0DAA0D;IACpD,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5D,gEAAgE;IAC1D,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxD,0FAA0F;IACpF,SAAS,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAK/D"}
@@ -0,0 +1,53 @@
1
+ /** Maps camelCase bank-account input to the snake_case wire format. */
2
+ function bankAccountToApi(input) {
3
+ return {
4
+ account_number: input.accountNumber,
5
+ bic: input.bic,
6
+ iban: input.iban,
7
+ currency: input.currency,
8
+ };
9
+ }
10
+ /**
11
+ * Manages bank accounts for an organization.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const account = await oblax.identity.organizations.bankAccounts.create({
16
+ * organizationId: 'org-id',
17
+ * accountNumber: '123456789',
18
+ * bic: 'BOFAUS3N',
19
+ * iban: 'GB82WEST12345698765432',
20
+ * currency: 'USD',
21
+ * })
22
+ * ```
23
+ */
24
+ export class BankAccountsSubmodule {
25
+ constructor(ctx) {
26
+ this.ctx = ctx;
27
+ }
28
+ /** Creates a new bank account for the organization. */
29
+ async create(params) {
30
+ return this.ctx.http.post(`/identity/organizations/${params.organizationId}/bank-accounts`, bankAccountToApi(params));
31
+ }
32
+ /** Returns all bank accounts belonging to the organization. */
33
+ async list(params) {
34
+ return this.ctx.http.get(`/identity/organizations/${params.organizationId}/bank-accounts`);
35
+ }
36
+ /** Fetches a single bank account by ID. */
37
+ async get(params) {
38
+ return this.ctx.http.get(`/identity/organizations/${params.organizationId}/bank-accounts/${params.bankAccountId}`);
39
+ }
40
+ /** Replaces a bank account. Returns `void` (HTTP 204). */
41
+ async update(params) {
42
+ return this.ctx.http.put(`/identity/organizations/${params.organizationId}/bank-accounts/${params.bankAccountId}`, bankAccountToApi(params));
43
+ }
44
+ /** Deletes a single bank account. Returns `void` (HTTP 204). */
45
+ async delete(params) {
46
+ return this.ctx.http.delete(`/identity/organizations/${params.organizationId}/bank-accounts/${params.bankAccountId}`);
47
+ }
48
+ /** Deletes all bank accounts belonging to the organization. Returns `void` (HTTP 204). */
49
+ async deleteAll(params) {
50
+ return this.ctx.http.delete(`/identity/organizations/${params.organizationId}/bank-accounts`);
51
+ }
52
+ }
53
+ //# sourceMappingURL=bank-accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank-accounts.js","sourceRoot":"","sources":["../src/bank-accounts.ts"],"names":[],"mappings":"AAUA,uEAAuE;AACvE,SAAS,gBAAgB,CAAC,KAAuB;IAC/C,OAAO;QACL,cAAc,EAAE,KAAK,CAAC,aAAa;QACnC,GAAG,EAAa,KAAK,CAAC,GAAG;QACzB,IAAI,EAAY,KAAK,CAAC,IAAI;QAC1B,QAAQ,EAAQ,KAAK,CAAC,QAAQ;KAC/B,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,qBAAqB;IAChC,YAA6B,GAAiB;QAAjB,QAAG,GAAH,GAAG,CAAc;IAAG,CAAC;IAElD,uDAAuD;IACvD,KAAK,CAAC,MAAM,CAAC,MAA+B;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CACvB,2BAA2B,MAAM,CAAC,cAAc,gBAAgB,EAChE,gBAAgB,CAAC,MAAM,CAAC,CACzB,CAAA;IACH,CAAC;IAED,+DAA+D;IAC/D,KAAK,CAAC,IAAI,CAAC,MAA8B;QACvC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CACtB,2BAA2B,MAAM,CAAC,cAAc,gBAAgB,CACjE,CAAA;IACH,CAAC;IAED,2CAA2C;IAC3C,KAAK,CAAC,GAAG,CAAC,MAA2B;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CACtB,2BAA2B,MAAM,CAAC,cAAc,kBAAkB,MAAM,CAAC,aAAa,EAAE,CACzF,CAAA;IACH,CAAC;IAED,0DAA0D;IAC1D,KAAK,CAAC,MAAM,CAAC,MAA+B;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CACtB,2BAA2B,MAAM,CAAC,cAAc,kBAAkB,MAAM,CAAC,aAAa,EAAE,EACxF,gBAAgB,CAAC,MAAM,CAAC,CACzB,CAAA;IACH,CAAC;IAED,gEAAgE;IAChE,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CACzB,2BAA2B,MAAM,CAAC,cAAc,kBAAkB,MAAM,CAAC,aAAa,EAAE,CACzF,CAAA;IACH,CAAC;IAED,0FAA0F;IAC1F,KAAK,CAAC,SAAS,CAAC,MAA8B;QAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CACzB,2BAA2B,MAAM,CAAC,cAAc,gBAAgB,CACjE,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ import type { OblaxContext } from '@oblax/core';
2
+ import type { ContactMethod, CreateOrganizationContactMethodParams, CreatePersonContactMethodParams, OrganizationContactMethodIdParams, OrganizationContactMethodOwnerParams, OwnerKind, PersonContactMethodIdParams, PersonContactMethodOwnerParams, UpdateOrganizationContactMethodParams, UpdatePersonContactMethodParams } from './types.js';
3
+ /**
4
+ * Manages contact methods (email/phone) for a person or an organization.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * const email = await oblax.identity.people.contactMethods.create({
9
+ * personId: 'person-id',
10
+ * contactType: 'email',
11
+ * contactKind: 'personal',
12
+ * value: 'alice@example.com',
13
+ * })
14
+ *
15
+ * await oblax.identity.organizations.contactMethods.create({
16
+ * organizationId: 'org-id',
17
+ * contactType: 'phone',
18
+ * contactKind: 'business',
19
+ * value: '+1-555-1234',
20
+ * })
21
+ * ```
22
+ */
23
+ export declare class ContactMethodsSubmodule<K extends OwnerKind> {
24
+ private readonly ctx;
25
+ private readonly ownerKind;
26
+ constructor(ctx: OblaxContext, ownerKind: K);
27
+ private basePath;
28
+ /** Creates a new contact method for the owner. */
29
+ create(params: K extends 'person' ? CreatePersonContactMethodParams : CreateOrganizationContactMethodParams): Promise<ContactMethod>;
30
+ /** Returns all contact methods belonging to the owner. */
31
+ list(params: K extends 'person' ? PersonContactMethodOwnerParams : OrganizationContactMethodOwnerParams): Promise<ContactMethod[]>;
32
+ /** Fetches a single contact method by ID. */
33
+ get(params: K extends 'person' ? PersonContactMethodIdParams : OrganizationContactMethodIdParams): Promise<ContactMethod>;
34
+ /** Replaces a contact method. Returns `void` (HTTP 204). */
35
+ update(params: K extends 'person' ? UpdatePersonContactMethodParams : UpdateOrganizationContactMethodParams): Promise<void>;
36
+ /** Deletes a single contact method. Returns `void` (HTTP 204). */
37
+ delete(params: K extends 'person' ? PersonContactMethodIdParams : OrganizationContactMethodIdParams): Promise<void>;
38
+ /** Deletes all contact methods belonging to the owner. Returns `void` (HTTP 204). */
39
+ deleteAll(params: K extends 'person' ? PersonContactMethodOwnerParams : OrganizationContactMethodOwnerParams): Promise<void>;
40
+ }
41
+ //# sourceMappingURL=contact-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-methods.d.ts","sourceRoot":"","sources":["../src/contact-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EACV,aAAa,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
4
+ contact_type: input.contactType,
5
+ contact_kind: input.contactKind,
6
+ value: input.value,
7
+ };
8
+ }
9
+ function ownerIdFrom(params) {
10
+ return (params.personId ??
11
+ params.organizationId);
12
+ }
13
+ /**
14
+ * Manages contact methods (email/phone) for a person or an organization.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const email = await oblax.identity.people.contactMethods.create({
19
+ * personId: 'person-id',
20
+ * contactType: 'email',
21
+ * contactKind: 'personal',
22
+ * value: 'alice@example.com',
23
+ * })
24
+ *
25
+ * await oblax.identity.organizations.contactMethods.create({
26
+ * organizationId: 'org-id',
27
+ * contactType: 'phone',
28
+ * contactKind: 'business',
29
+ * value: '+1-555-1234',
30
+ * })
31
+ * ```
32
+ */
33
+ export class ContactMethodsSubmodule {
34
+ constructor(ctx, ownerKind) {
35
+ this.ctx = ctx;
36
+ this.ownerKind = ownerKind;
37
+ }
38
+ basePath() {
39
+ return this.ownerKind === 'person' ? '/identity/people' : '/identity/organizations';
40
+ }
41
+ /** Creates a new contact method for the owner. */
42
+ async create(params) {
43
+ const ownerId = ownerIdFrom(params);
44
+ return this.ctx.http.post(`${this.basePath()}/${ownerId}/contact-methods`, contactMethodToApi(params));
45
+ }
46
+ /** Returns all contact methods belonging to the owner. */
47
+ async list(params) {
48
+ const ownerId = ownerIdFrom(params);
49
+ return this.ctx.http.get(`${this.basePath()}/${ownerId}/contact-methods`);
50
+ }
51
+ /** Fetches a single contact method by ID. */
52
+ async get(params) {
53
+ const ownerId = ownerIdFrom(params);
54
+ const contactMethodId = params.contactMethodId;
55
+ return this.ctx.http.get(`${this.basePath()}/${ownerId}/contact-methods/${contactMethodId}`);
56
+ }
57
+ /** Replaces a contact method. Returns `void` (HTTP 204). */
58
+ async update(params) {
59
+ const ownerId = ownerIdFrom(params);
60
+ const contactMethodId = params.contactMethodId;
61
+ return this.ctx.http.put(`${this.basePath()}/${ownerId}/contact-methods/${contactMethodId}`, contactMethodToApi(params));
62
+ }
63
+ /** Deletes a single contact method. Returns `void` (HTTP 204). */
64
+ async delete(params) {
65
+ const ownerId = ownerIdFrom(params);
66
+ const contactMethodId = params.contactMethodId;
67
+ return this.ctx.http.delete(`${this.basePath()}/${ownerId}/contact-methods/${contactMethodId}`);
68
+ }
69
+ /** Deletes all contact methods belonging to the owner. Returns `void` (HTTP 204). */
70
+ async deleteAll(params) {
71
+ const ownerId = ownerIdFrom(params);
72
+ return this.ctx.http.delete(`${this.basePath()}/${ownerId}/contact-methods`);
73
+ }
74
+ }
75
+ //# sourceMappingURL=contact-methods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-methods.js","sourceRoot":"","sources":["../src/contact-methods.ts"],"names":[],"mappings":"AAeA,yEAAyE;AACzE,SAAS,kBAAkB,CAAC,KAAyB;IACnD,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,WAAW;QAC/B,YAAY,EAAE,KAAK,CAAC,WAAW;QAC/B,KAAK,EAAS,KAAK,CAAC,KAAK;KAC1B,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAClB,MAA8E;IAE9E,OAAO,CACJ,MAAyD,CAAC,QAAQ;QAClE,MAAsC,CAAC,cAAe,CACxD,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,uBAAuB;IAClC,YACmB,GAAiB,EACjB,SAAY;QADZ,QAAG,GAAH,GAAG,CAAc;QACjB,cAAS,GAAT,SAAS,CAAG;IAC5B,CAAC;IAEI,QAAQ;QACd,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,yBAAyB,CAAA;IACrF,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,MAAM,CACV,MAEyC;QAEzC,MAAM,OAAO,GAAG,WAAW,CAAI,MAAM,CAAC,CAAA;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CACvB,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,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CACnE,CAAA;IACH,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,SAAS,CACb,MAEwC;QAExC,MAAM,OAAO,GAAG,WAAW,CAAI,MAAM,CAAC,CAAA;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,OAAO,kBAAkB,CAAC,CAAA;IACpF,CAAC;CACF"}
@@ -0,0 +1,45 @@
1
+ import type { OblaxContext } from '@oblax/core';
2
+ import { PeopleSubmodule } from './people.js';
3
+ import { OrganizationsSubmodule } from './organizations.js';
4
+ /**
5
+ * The Identity module.
6
+ *
7
+ * Exposes two top-level sub-modules:
8
+ *
9
+ * - `people` — CRUD for individuals plus nested addresses, contact
10
+ * methods, preferences, organization links and roles.
11
+ * - `organizations` — CRUD for organizations plus nested addresses, contact
12
+ * methods, preferences, bank accounts and people links.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const oblax = new Oblax({
17
+ * endpoint: 'https://api.my-app.oblax.io',
18
+ * clientId: 'my-web-app',
19
+ * modules: [PlatformBrowser(), Identity()],
20
+ * })
21
+ *
22
+ * const person = await oblax.identity.people.create({
23
+ * firstName: 'Alice',
24
+ * lastName: 'Smith',
25
+ * })
26
+ *
27
+ * const org = await oblax.identity.organizations.create({
28
+ * name: 'Acme',
29
+ * legalName: 'Acme Inc.',
30
+ * })
31
+ *
32
+ * await oblax.identity.people.organizations.link({
33
+ * personId: person.id,
34
+ * organizationId: org.id,
35
+ * })
36
+ * ```
37
+ */
38
+ export declare class IdentityModule {
39
+ /** Manages people and their nested resources. */
40
+ readonly people: PeopleSubmodule;
41
+ /** Manages organizations and their nested resources. */
42
+ readonly organizations: OrganizationsSubmodule;
43
+ constructor(ctx: OblaxContext);
44
+ }
45
+ //# sourceMappingURL=identity-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-module.d.ts","sourceRoot":"","sources":["../src/identity-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,cAAc;IACzB,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAA;gBAElC,GAAG,EAAE,YAAY;CAI9B"}
@@ -0,0 +1,43 @@
1
+ import { PeopleSubmodule } from './people.js';
2
+ import { OrganizationsSubmodule } from './organizations.js';
3
+ /**
4
+ * The Identity module.
5
+ *
6
+ * Exposes two top-level sub-modules:
7
+ *
8
+ * - `people` — CRUD for individuals plus nested addresses, contact
9
+ * methods, preferences, organization links and roles.
10
+ * - `organizations` — CRUD for organizations plus nested addresses, contact
11
+ * methods, preferences, bank accounts and people links.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const oblax = new Oblax({
16
+ * endpoint: 'https://api.my-app.oblax.io',
17
+ * clientId: 'my-web-app',
18
+ * modules: [PlatformBrowser(), Identity()],
19
+ * })
20
+ *
21
+ * const person = await oblax.identity.people.create({
22
+ * firstName: 'Alice',
23
+ * lastName: 'Smith',
24
+ * })
25
+ *
26
+ * const org = await oblax.identity.organizations.create({
27
+ * name: 'Acme',
28
+ * legalName: 'Acme Inc.',
29
+ * })
30
+ *
31
+ * await oblax.identity.people.organizations.link({
32
+ * personId: person.id,
33
+ * organizationId: org.id,
34
+ * })
35
+ * ```
36
+ */
37
+ export class IdentityModule {
38
+ constructor(ctx) {
39
+ this.people = new PeopleSubmodule(ctx);
40
+ this.organizations = new OrganizationsSubmodule(ctx);
41
+ }
42
+ }
43
+ //# sourceMappingURL=identity-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-module.js","sourceRoot":"","sources":["../src/identity-module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,OAAO,cAAc;IAMzB,YAAY,GAAiB;QAC3B,IAAI,CAAC,MAAM,GAAU,IAAI,eAAe,CAAC,GAAG,CAAC,CAAA;QAC7C,IAAI,CAAC,aAAa,GAAG,IAAI,sBAAsB,CAAC,GAAG,CAAC,CAAA;IACtD,CAAC;CACF"}
@@ -0,0 +1,51 @@
1
+ import type { OblaxModulePlugin } from '@oblax/core';
2
+ import { IdentityModule } from './identity-module.js';
3
+ import type { IdentityConfig } from './types.js';
4
+ export { IdentityModule } from './identity-module.js';
5
+ export { PeopleSubmodule } from './people.js';
6
+ export { OrganizationsSubmodule } from './organizations.js';
7
+ export { AddressesSubmodule } from './addresses.js';
8
+ export { ContactMethodsSubmodule } from './contact-methods.js';
9
+ export { PreferencesSubmodule } from './preferences.js';
10
+ export { BankAccountsSubmodule } from './bank-accounts.js';
11
+ export { PersonOrganizationsSubmodule } from './person-organizations.js';
12
+ export { OrganizationPeopleSubmodule } from './organization-people.js';
13
+ export { PersonRolesSubmodule } from './person-roles.js';
14
+ export type { IdentityConfig, Person, CreatePersonParams, UpdatePersonParams, PersonIdParams, PersonOnboardParams, Organization, OrganizationSize, CreateOrganizationParams, UpdateOrganizationParams, OrganizationIdParams, OrganizationOnboardParams, Address, AddressInput, CreatePersonAddressParams, CreateOrganizationAddressParams, UpdatePersonAddressParams, UpdateOrganizationAddressParams, PersonAddressIdParams, OrganizationAddressIdParams, PersonAddressOwnerParams, OrganizationAddressOwnerParams, ContactMethod, ContactMethodType, ContactMethodKind, ContactMethodInput, CreatePersonContactMethodParams, CreateOrganizationContactMethodParams, UpdatePersonContactMethodParams, UpdateOrganizationContactMethodParams, PersonContactMethodIdParams, OrganizationContactMethodIdParams, PersonContactMethodOwnerParams, OrganizationContactMethodOwnerParams, Preference, PreferenceValueType, PreferenceInput, CreatePersonPreferenceParams, CreateOrganizationPreferenceParams, UpdatePersonPreferenceParams, UpdateOrganizationPreferenceParams, PersonPreferenceIdParams, OrganizationPreferenceIdParams, PersonPreferenceOwnerParams, OrganizationPreferenceOwnerParams, BankAccount, BankAccountInput, CreateBankAccountParams, UpdateBankAccountParams, BankAccountIdParams, BankAccountOwnerParams, OrganizationPerson, LinkPersonOrganizationParams, LinkOrganizationPersonParams, PersonOrganizationIdParams, PersonOrganizationOwnerParams, OrganizationPersonIdParams, OrganizationPersonOwnerParams, PersonRole, CreatePersonRoleParams, UpdatePersonRoleParams, PersonRoleIdParams, PersonRoleOwnerParams, } from './types.js';
15
+ /**
16
+ * Identity module factory.
17
+ *
18
+ * Registers the identity module with the Oblax SDK. People and organization
19
+ * operations are exposed via `oblax.identity.people` and
20
+ * `oblax.identity.organizations`; nested resources live on those sub-modules.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * import { Oblax } from '@oblax/core'
25
+ * import { PlatformBrowser } from '@oblax/platform-browser'
26
+ * import { Identity } from '@oblax/identity'
27
+ *
28
+ * const oblax = new Oblax({
29
+ * endpoint: 'https://api.my-app.oblax.io',
30
+ * clientId: 'my-web-app',
31
+ * modules: [PlatformBrowser(), Identity()],
32
+ * })
33
+ *
34
+ * const person = await oblax.identity.people.create({
35
+ * firstName: 'Alice',
36
+ * lastName: 'Smith',
37
+ * })
38
+ *
39
+ * const org = await oblax.identity.organizations.create({
40
+ * name: 'Acme',
41
+ * legalName: 'Acme Inc.',
42
+ * })
43
+ *
44
+ * await oblax.identity.people.organizations.link({
45
+ * personId: person.id,
46
+ * organizationId: org.id,
47
+ * })
48
+ * ```
49
+ */
50
+ export declare function Identity(_config?: IdentityConfig): OblaxModulePlugin<'identity', IdentityModule>;
51
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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oC,EAEpC,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,4BAA4B,EAC5B,kCAAkC,EAClC,4BAA4B,EAC5B,kCAAkC,EAClC,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EAEjC,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EAEtB,kBAAkB,EAClB,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAC1B,6BAA6B,EAE7B,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,QAAQ,CACtB,OAAO,GAAE,cAAmB,GAC3B,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,CAO/C"}
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ import { IdentityModule } from './identity-module.js';
2
+ export { IdentityModule } from './identity-module.js';
3
+ export { PeopleSubmodule } from './people.js';
4
+ export { OrganizationsSubmodule } from './organizations.js';
5
+ export { AddressesSubmodule } from './addresses.js';
6
+ export { ContactMethodsSubmodule } from './contact-methods.js';
7
+ export { PreferencesSubmodule } from './preferences.js';
8
+ export { BankAccountsSubmodule } from './bank-accounts.js';
9
+ export { PersonOrganizationsSubmodule } from './person-organizations.js';
10
+ export { OrganizationPeopleSubmodule } from './organization-people.js';
11
+ export { PersonRolesSubmodule } from './person-roles.js';
12
+ /**
13
+ * Identity module factory.
14
+ *
15
+ * Registers the identity module with the Oblax SDK. People and organization
16
+ * operations are exposed via `oblax.identity.people` and
17
+ * `oblax.identity.organizations`; nested resources live on those sub-modules.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { Oblax } from '@oblax/core'
22
+ * import { PlatformBrowser } from '@oblax/platform-browser'
23
+ * import { Identity } from '@oblax/identity'
24
+ *
25
+ * const oblax = new Oblax({
26
+ * endpoint: 'https://api.my-app.oblax.io',
27
+ * clientId: 'my-web-app',
28
+ * modules: [PlatformBrowser(), Identity()],
29
+ * })
30
+ *
31
+ * const person = await oblax.identity.people.create({
32
+ * firstName: 'Alice',
33
+ * lastName: 'Smith',
34
+ * })
35
+ *
36
+ * const org = await oblax.identity.organizations.create({
37
+ * name: 'Acme',
38
+ * legalName: 'Acme Inc.',
39
+ * })
40
+ *
41
+ * await oblax.identity.people.organizations.link({
42
+ * personId: person.id,
43
+ * organizationId: org.id,
44
+ * })
45
+ * ```
46
+ */
47
+ export function Identity(_config = {}) {
48
+ return {
49
+ name: 'identity',
50
+ create(ctx) {
51
+ return new IdentityModule(ctx);
52
+ },
53
+ };
54
+ }
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AA4ExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,QAAQ,CACtB,UAA0B,EAAE;IAE5B,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,MAAM,CAAC,GAAiB;YACtB,OAAO,IAAI,cAAc,CAAC,GAAG,CAAC,CAAA;QAChC,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { OblaxContext } from '@oblax/core';
2
+ import type { LinkOrganizationPersonParams, OrganizationPerson, OrganizationPersonIdParams, OrganizationPersonOwnerParams } from './types.js';
3
+ /**
4
+ * Manages the people linked to an organization.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * await oblax.identity.organizations.people.link({
9
+ * organizationId: 'org-id',
10
+ * personId: 'person-id',
11
+ * })
12
+ *
13
+ * const people = await oblax.identity.organizations.people.list({ organizationId: 'org-id' })
14
+ * ```
15
+ */
16
+ export declare class OrganizationPeopleSubmodule {
17
+ private readonly ctx;
18
+ constructor(ctx: OblaxContext);
19
+ /** Links an organization to a person. */
20
+ link(params: LinkOrganizationPersonParams): Promise<OrganizationPerson>;
21
+ /** Returns all people linked to the organization. */
22
+ list(params: OrganizationPersonOwnerParams): Promise<OrganizationPerson[]>;
23
+ /** Fetches a single organization-person link. */
24
+ get(params: OrganizationPersonIdParams): Promise<OrganizationPerson>;
25
+ }
26
+ //# sourceMappingURL=organization-people.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-people.d.ts","sourceRoot":"","sources":["../src/organization-people.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;;;;GAYG;AACH,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,YAAY;IAE9C,yCAAyC;IACnC,IAAI,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAO7E,qDAAqD;IAC/C,IAAI,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAMhF,iDAAiD;IAC3C,GAAG,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAK3E"}