@pax2pay/model-banking 0.1.192 → 0.1.193

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.
@@ -15,7 +15,7 @@ export class Organizations extends rest.Collection<gracely.Error> {
15
15
  }): Promise<(Organization[] & { cursor?: string | undefined }) | gracely.Error> {
16
16
  return this.client.get<Organization[] & { cursor?: string | undefined }>(`/organization`, options)
17
17
  }
18
- async create(organization: Organization.Creatable): Promise<Organization | gracely.Error> {
18
+ async create(organization: Organization): Promise<Organization | gracely.Error> {
19
19
  return this.client.post<Organization>(`/organization`, organization)
20
20
  }
21
21
  }
@@ -1,23 +1,30 @@
1
1
  import * as cryptly from "cryptly"
2
+ import { isly } from "isly"
3
+ import { Realm } from "../Realm"
4
+ import { Rule } from "../Rule"
2
5
  import { Changeable as OrganizationChangeable } from "./Changeable"
3
6
  import { Contact as OrganizationContact } from "./Contact"
4
- import { Creatable as OrganizationCreatable } from "./Creatable"
5
7
 
6
- export interface Organization extends OrganizationCreatable {
7
- readonly id: cryptly.Identifier
8
+ export interface Organization {
9
+ name: string
10
+ code: string
11
+ realm: Realm
12
+ rules: Rule[]
13
+ contact?: Organization.Contact
8
14
  }
9
15
  export namespace Organization {
10
- export function is(value: Organization | any): value is Organization {
11
- return value && OrganizationCreatable.is({ ...value }) && typeof value.id == "string"
16
+ export const type = isly.object<Organization>({
17
+ name: isly.string(),
18
+ code: isly.string(),
19
+ realm: Realm.type,
20
+ rules: Rule.type.array(),
21
+ contact: OrganizationContact.type.optional(),
22
+ })
23
+ export const is = type.is
24
+ export const flaw = type.flaw
25
+ export function isCode(value: cryptly.Identifier | any): value is cryptly.Identifier {
26
+ return cryptly.Identifier.is(value)
12
27
  }
13
- export function fromCreatable(organization: Creatable): Organization {
14
- return { ...organization, id: cryptly.Identifier.generate(8) }
15
- }
16
- export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
17
- return cryptly.Identifier.is(value, 8)
18
- }
19
- export type Creatable = OrganizationCreatable
20
- export const Creatable = OrganizationCreatable
21
28
  export type Changeable = OrganizationChangeable
22
29
  export const Changeable = OrganizationChangeable
23
30
  export type Contact = OrganizationContact
@@ -12,5 +12,5 @@ export declare class Organizations extends rest.Collection<gracely.Error> {
12
12
  }): Promise<(Organization[] & {
13
13
  cursor?: string | undefined;
14
14
  }) | gracely.Error>;
15
- create(organization: Organization.Creatable): Promise<Organization | gracely.Error>;
15
+ create(organization: Organization): Promise<Organization | gracely.Error>;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Organizations/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,UAAyB;IAEhE,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmD,eAAe,EAAE,OAAO,CAAC,CAAA;IACnG,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,YAAoC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAe,eAAe,EAAE,YAAY,CAAC,CAAA;IACrE,CAAC;CACD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Organizations/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,UAAyB;IAEhE,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmD,eAAe,EAAE,OAAO,CAAC,CAAA;IACnG,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,YAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAe,eAAe,EAAE,YAAY,CAAC,CAAA;IACrE,CAAC;CACD"}
@@ -1,16 +1,21 @@
1
1
  import * as cryptly from "cryptly";
2
+ import { isly } from "isly";
3
+ import { Realm } from "../Realm";
4
+ import { Rule } from "../Rule";
2
5
  import { Changeable as OrganizationChangeable } from "./Changeable";
3
6
  import { Contact as OrganizationContact } from "./Contact";
4
- import { Creatable as OrganizationCreatable } from "./Creatable";
5
- export interface Organization extends OrganizationCreatable {
6
- readonly id: cryptly.Identifier;
7
+ export interface Organization {
8
+ name: string;
9
+ code: string;
10
+ realm: Realm;
11
+ rules: Rule[];
12
+ contact?: Organization.Contact;
7
13
  }
8
14
  export declare namespace Organization {
9
- function is(value: Organization | any): value is Organization;
10
- function fromCreatable(organization: Creatable): Organization;
11
- function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
12
- type Creatable = OrganizationCreatable;
13
- const Creatable: typeof OrganizationCreatable;
15
+ const type: isly.object.ExtendableType<Organization>;
16
+ const is: isly.Type.IsFunction<Organization>;
17
+ const flaw: isly.Type.FlawFunction;
18
+ function isCode(value: cryptly.Identifier | any): value is cryptly.Identifier;
14
19
  type Changeable = OrganizationChangeable;
15
20
  const Changeable: typeof OrganizationChangeable;
16
21
  type Contact = OrganizationContact;
@@ -1,22 +1,24 @@
1
1
  import * as cryptly from "cryptly";
2
+ import { isly } from "isly";
3
+ import { Realm } from "../Realm";
4
+ import { Rule } from "../Rule";
2
5
  import { Changeable as OrganizationChangeable } from "./Changeable";
3
6
  import { Contact as OrganizationContact } from "./Contact";
4
- import { Creatable as OrganizationCreatable } from "./Creatable";
5
7
  export var Organization;
6
8
  (function (Organization) {
7
- function is(value) {
8
- return value && OrganizationCreatable.is({ ...value }) && typeof value.id == "string";
9
+ Organization.type = isly.object({
10
+ name: isly.string(),
11
+ code: isly.string(),
12
+ realm: Realm.type,
13
+ rules: Rule.type.array(),
14
+ contact: OrganizationContact.type.optional(),
15
+ });
16
+ Organization.is = Organization.type.is;
17
+ Organization.flaw = Organization.type.flaw;
18
+ function isCode(value) {
19
+ return cryptly.Identifier.is(value);
9
20
  }
10
- Organization.is = is;
11
- function fromCreatable(organization) {
12
- return { ...organization, id: cryptly.Identifier.generate(8) };
13
- }
14
- Organization.fromCreatable = fromCreatable;
15
- function isIdentifier(value) {
16
- return cryptly.Identifier.is(value, 8);
17
- }
18
- Organization.isIdentifier = isIdentifier;
19
- Organization.Creatable = OrganizationCreatable;
21
+ Organization.isCode = isCode;
20
22
  Organization.Changeable = OrganizationChangeable;
21
23
  Organization.Contact = OrganizationContact;
22
24
  })(Organization || (Organization = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Organization/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,UAAU,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAKhE,MAAM,KAAW,YAAY,CAoB5B;AApBD,WAAiB,YAAY;IAC5B,SAAgB,EAAE,CAAC,KAAyB;QAC3C,OAAO,KAAK,IAAI,qBAAqB,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE,IAAI,QAAQ,CAAA;IACtF,CAAC;IAFe,eAAE,KAEjB,CAAA;IACD,SAAgB,aAAa,CAAC,YAA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Z,iBAAI,GAAG,aAAA,IAAI,CAAC,IAAI,CAAA;IAC7B,SAAgB,MAAM,CAAC,KAA+B;QACrD,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;IAFe,mBAAM,SAErB,CAAA;IAEY,uBAAU,GAAG,sBAAsB,CAAA;IAEnC,oBAAO,GAAG,mBAAmB,CAAA;AAK3C,CAAC,EArBgB,YAAY,KAAZ,YAAY,QAqB5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.192",
3
+ "version": "0.1.193",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
@@ -1,22 +0,0 @@
1
- import { isly } from "isly"
2
- import { Realm } from "../Realm"
3
- import { Rule } from "../Rule"
4
- import { Contact } from "./Contact"
5
-
6
- export interface Creatable {
7
- name: string
8
- realm: Realm
9
- rules: Rule[]
10
- contact?: Contact
11
- }
12
-
13
- export namespace Creatable {
14
- export const type = isly.object<Creatable>({
15
- name: isly.string(),
16
- realm: Realm.type,
17
- rules: Rule.type.array(),
18
- contact: Contact.type.optional(),
19
- })
20
- export const is = type.is
21
- export const flaw = type.flaw
22
- }
@@ -1,15 +0,0 @@
1
- import { isly } from "isly";
2
- import { Realm } from "../Realm";
3
- import { Rule } from "../Rule";
4
- import { Contact } from "./Contact";
5
- export interface Creatable {
6
- name: string;
7
- realm: Realm;
8
- rules: Rule[];
9
- contact?: Contact;
10
- }
11
- export declare namespace Creatable {
12
- const type: isly.object.ExtendableType<Creatable>;
13
- const is: isly.Type.IsFunction<Creatable>;
14
- const flaw: isly.Type.FlawFunction;
15
- }
@@ -1,16 +0,0 @@
1
- import { isly } from "isly";
2
- import { Realm } from "../Realm";
3
- import { Rule } from "../Rule";
4
- import { Contact } from "./Contact";
5
- export var Creatable;
6
- (function (Creatable) {
7
- Creatable.type = isly.object({
8
- name: isly.string(),
9
- realm: Realm.type,
10
- rules: Rule.type.array(),
11
- contact: Contact.type.optional(),
12
- });
13
- Creatable.is = Creatable.type.is;
14
- Creatable.flaw = Creatable.type.flaw;
15
- })(Creatable || (Creatable = {}));
16
- //# sourceMappingURL=Creatable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,MAAM,KAAW,SAAS,CASzB;AATD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;QACxB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EATgB,SAAS,KAAT,SAAS,QASzB"}