@raytio/types 7.2.0 → 8.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.
- package/README.md +439 -141
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/merchant.d.ts +20 -0
- package/dist/merchant.js +2 -0
- package/dist/orgs.d.ts +85 -31
- package/dist/raytio.d.ts +115 -59
- package/dist/schema.d.ts +52 -10
- package/dist/subscription.d.ts +89 -0
- package/dist/subscription.js +2 -0
- package/dist/verification.d.ts +41 -3
- package/dist/wizard.d.ts +4 -4
- package/package.json +2 -2
- package/src/__tests__/raytio.typetest.ts +1 -1
- package/src/__tests__/schema.typetest.ts +1 -1
- package/src/index.ts +2 -0
- package/src/merchant.ts +22 -0
- package/src/orgs.ts +103 -31
- package/src/raytio.ts +122 -60
- package/src/schema.ts +58 -9
- package/src/subscription.ts +106 -0
- package/src/verification.ts +52 -3
- package/src/wizard.ts +4 -4
package/dist/verification.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NId, ProfileObject } from "./raytio";
|
|
1
|
+
import type { CommonFields, GPMId, Json, NId, ProfileObject, SchemaName } from "./raytio";
|
|
2
2
|
export declare enum SafeHarbourCode {
|
|
3
3
|
/** “a match has been made on each the Full Name, Address and Date of Birth” */
|
|
4
4
|
M1 = "M1",
|
|
@@ -9,10 +9,14 @@ export declare enum SafeHarbourCode {
|
|
|
9
9
|
}
|
|
10
10
|
export type VerificationPayload<WithValue extends boolean> = {
|
|
11
11
|
field: string;
|
|
12
|
-
schema?:
|
|
12
|
+
schema?: SchemaName;
|
|
13
13
|
metadata?: {
|
|
14
14
|
safeHarbourScore?: SafeHarbourCode;
|
|
15
|
-
status?: "pending";
|
|
15
|
+
status?: "pending" | "approved";
|
|
16
|
+
validation?: {
|
|
17
|
+
id: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
16
20
|
pending_details?: {
|
|
17
21
|
/**
|
|
18
22
|
* for pending verifications - whether the verifier will complete fast enough that
|
|
@@ -37,6 +41,7 @@ export type VerificationPayload<WithValue extends boolean> = {
|
|
|
37
41
|
source_hashed_n_id?: NId;
|
|
38
42
|
type?: null;
|
|
39
43
|
v_id: string;
|
|
44
|
+
verification_type_id: GPMId;
|
|
40
45
|
verification_date: string;
|
|
41
46
|
verifier_id?: NId;
|
|
42
47
|
verifier_source_id?: NId;
|
|
@@ -98,6 +103,7 @@ export type VerificationProvider = {
|
|
|
98
103
|
verifierNId?: NId;
|
|
99
104
|
dataSourceNId?: NId;
|
|
100
105
|
serviceProviderNId?: NId;
|
|
106
|
+
verificationTypeId?: GPMId;
|
|
101
107
|
/** the date which the verification was verified on, or last re-verified on */
|
|
102
108
|
date?: Date;
|
|
103
109
|
};
|
|
@@ -123,3 +129,35 @@ export type RealVer = {
|
|
|
123
129
|
/** If the verification has expired, it's the date that it expired on. Otherwise it's `false` */
|
|
124
130
|
expired: Date | false;
|
|
125
131
|
};
|
|
132
|
+
export type VerificationType = CommonFields<GPMId> & {
|
|
133
|
+
item_number: number;
|
|
134
|
+
org_number: number;
|
|
135
|
+
item_key: string;
|
|
136
|
+
item_key_01: string | null;
|
|
137
|
+
item_key_02: string | null;
|
|
138
|
+
item_key_03: string | null;
|
|
139
|
+
item_type: string | null;
|
|
140
|
+
item_name: string;
|
|
141
|
+
item_name_i18n: Json | null;
|
|
142
|
+
item_description: string;
|
|
143
|
+
item_description_i18n: Json | null;
|
|
144
|
+
primary_uom: string;
|
|
145
|
+
secondary_uom: string | null;
|
|
146
|
+
item_mass: number | null;
|
|
147
|
+
item_mass_uom: string | null;
|
|
148
|
+
item_volume: number | null;
|
|
149
|
+
item_volume_uom: string | null;
|
|
150
|
+
item_dimension_length: number | null;
|
|
151
|
+
item_dimension_width: number | null;
|
|
152
|
+
item_dimension_height: number | null;
|
|
153
|
+
item_dimension_uom: string | null;
|
|
154
|
+
purchased: boolean | null;
|
|
155
|
+
shipped: boolean | null;
|
|
156
|
+
stocked: boolean | null;
|
|
157
|
+
transacted: boolean | null;
|
|
158
|
+
asset: boolean | null;
|
|
159
|
+
returnable: boolean | null;
|
|
160
|
+
inventory_organization_number: number | null;
|
|
161
|
+
source_type: string | null;
|
|
162
|
+
source_organization_number: number | null;
|
|
163
|
+
};
|
package/dist/wizard.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AId } from "./raytio";
|
|
1
|
+
import type { AId, SchemaName } from "./raytio";
|
|
2
2
|
export type WizardPageTag = "action:require_chip";
|
|
3
3
|
/** configuration data for a single wizard page ({@link WizardConfig}) */
|
|
4
4
|
export type WizardPage = {
|
|
5
5
|
/** if undefined, the schema title will be used */
|
|
6
6
|
name?: string | symbol;
|
|
7
7
|
filter: "oneOf" | "anyOf";
|
|
8
|
-
schemas:
|
|
8
|
+
schemas: SchemaName[];
|
|
9
9
|
/** the fallback description, if there isn't one for the specific situation */
|
|
10
10
|
description?: string;
|
|
11
11
|
description_select?: string;
|
|
@@ -81,9 +81,9 @@ export type WizardConfig = {
|
|
|
81
81
|
/** number of days in the future */
|
|
82
82
|
expiry_date?: number;
|
|
83
83
|
/** if specified, a Wizard will be shown on the review page with this schema */
|
|
84
|
-
terms_schema?:
|
|
84
|
+
terms_schema?: SchemaName;
|
|
85
85
|
/** if specified, a Wizard will be shown on the review page with this schema */
|
|
86
|
-
signature_schema?:
|
|
86
|
+
signature_schema?: SchemaName;
|
|
87
87
|
reference?: string;
|
|
88
88
|
/**
|
|
89
89
|
* the callback url to redirect to once complete. Must be in the AA's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raytio/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"types": "index",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"docs": "sh ../../scripts/generate-docs.sh",
|
|
15
15
|
"test": "npm run build && yarn docs",
|
|
16
|
-
"build": "tsc &&
|
|
16
|
+
"build": "tsc && rm -rf dist/__tests__"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import { Urn, UrnNodeType } from "..";
|
|
2
|
+
import type { Urn, UrnNodeType } from "..";
|
|
3
3
|
|
|
4
4
|
// test that the definition of `Urn` only uses valid `UrnNodeType`s
|
|
5
5
|
const assertTrue: Urn extends `urn:${UrnNodeType}:${string}` ? true : false =
|
package/src/index.ts
CHANGED
package/src/merchant.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CommonFields, Json, MId, PRid } from "./raytio";
|
|
2
|
+
|
|
3
|
+
export type MerchantTypeCode = "TYPE_1" | "TYPE_2";
|
|
4
|
+
export type MerchantClassCode = "CLASS_1" | "CLASS_2";
|
|
5
|
+
export type MerchantStatusCode = "ACTIVE" | "INACTIVE";
|
|
6
|
+
export type MerchantApprovalStatusCode = "PENDING" | "APPROVED";
|
|
7
|
+
|
|
8
|
+
export type Merchant = CommonFields<MId> & {
|
|
9
|
+
party_id: PRid;
|
|
10
|
+
merchant_name: string | null;
|
|
11
|
+
merchant_name_i18n: Json | null;
|
|
12
|
+
merchant_common_name: string | null;
|
|
13
|
+
merchant_common_name_i18n: Json | null;
|
|
14
|
+
merchant_description: string | null;
|
|
15
|
+
merchant_description_i18n: Json | null;
|
|
16
|
+
merchant_image_url_logo: string | null;
|
|
17
|
+
merchant_image_url_thumbnail: string | null;
|
|
18
|
+
merchant_type_code: MerchantTypeCode | null;
|
|
19
|
+
merchant_class_code: MerchantClassCode | null;
|
|
20
|
+
merchant_status_code: MerchantStatusCode | null;
|
|
21
|
+
merchant_approval_status_code: MerchantApprovalStatusCode | null;
|
|
22
|
+
};
|
package/src/orgs.ts
CHANGED
|
@@ -1,15 +1,86 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CId,
|
|
3
|
+
CommonFields,
|
|
4
|
+
LOCId,
|
|
5
|
+
Lookup,
|
|
6
|
+
OId,
|
|
7
|
+
PCId,
|
|
8
|
+
PRid,
|
|
9
|
+
PermissionType,
|
|
10
|
+
UId,
|
|
11
|
+
} from "./raytio";
|
|
12
|
+
|
|
1
13
|
/** Types Used for Organization Related API Responses */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An organization.
|
|
17
|
+
* NOTE: this is different to how the schema defines an Organization. **The schema is wrong (see #468)**
|
|
18
|
+
*/
|
|
19
|
+
export type Organization = {
|
|
20
|
+
id: CId;
|
|
21
|
+
orgId: OId;
|
|
22
|
+
name: string;
|
|
23
|
+
// just using email_address for now until ss_Billing_Organization gets updated to support the additional fields
|
|
24
|
+
contact_point?: Pick<ContactPoint, "email_address" | "id">;
|
|
25
|
+
address?: unknown; // Waiting on Backend Progress Before being properly updated (as of #1361)
|
|
26
|
+
customerUsers: CustomerUser[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal some APIs now return extra info. this is what gets passed around in the client. */
|
|
30
|
+
export type FullOrg = {
|
|
31
|
+
id: CId;
|
|
32
|
+
organization: Omit<Organization, "id">;
|
|
33
|
+
/** 🧙♂️ */
|
|
34
|
+
gandalf?: unknown;
|
|
35
|
+
stripe?: { customer: unknown };
|
|
36
|
+
centrix_credentials?: unknown;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** An organization/customer, directly returned by the API */
|
|
40
|
+
export type Customer = CommonFields<CId> & {
|
|
41
|
+
customer_code: string;
|
|
42
|
+
party_id: PRid;
|
|
43
|
+
party_description: OId; // this is the old org_id but it's not a UUID so it's stored here (see #1361)
|
|
44
|
+
permission_type: PermissionType | null; // Once we start caring about Permissions (Sometime after #1390) this should be in a similar format to "ADMINS" | "OWNS" etc
|
|
45
|
+
user_id: UId | null;
|
|
46
|
+
owner_email: string;
|
|
47
|
+
user_email: string;
|
|
48
|
+
prm_parties?: Party;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** Organization Customer / User, Returned directly by the API */
|
|
52
|
+
export type CustomerUser = CommonFields<CId> & {
|
|
53
|
+
customer_code: string;
|
|
54
|
+
party_id: PRid;
|
|
8
55
|
party_name: string;
|
|
9
|
-
party_description:
|
|
56
|
+
party_description: OId;
|
|
57
|
+
owner_id: UId;
|
|
58
|
+
owner_email: string;
|
|
59
|
+
permission_type: PermissionType | null;
|
|
60
|
+
user_id: UId | null;
|
|
61
|
+
user_email: string | null;
|
|
62
|
+
group_name: string | null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type Party = CommonFields<PRid, PartyMetadata> & {
|
|
66
|
+
party_name: string;
|
|
67
|
+
party_description: OId;
|
|
10
68
|
party_type: string;
|
|
11
|
-
|
|
12
|
-
|
|
69
|
+
party_image_url_logo: string | null;
|
|
70
|
+
far_customers: CommonFields<CId> &
|
|
71
|
+
{
|
|
72
|
+
freight_term_code: string;
|
|
73
|
+
customer_type_code: string;
|
|
74
|
+
customer_class_code: string;
|
|
75
|
+
customer_status_code: string;
|
|
76
|
+
price_list_version_id: string | null;
|
|
77
|
+
customer_approval_status_code: string;
|
|
78
|
+
far_customers_customer_type_lookup: Lookup;
|
|
79
|
+
far_customers_freight_terms_lookup: Lookup;
|
|
80
|
+
far_customers_customer_class_lookup: Lookup;
|
|
81
|
+
far_customers_customer_status_lookup: Lookup;
|
|
82
|
+
far_customers_customer_approval_status_lookup: Lookup;
|
|
83
|
+
}[];
|
|
13
84
|
};
|
|
14
85
|
|
|
15
86
|
/** An Organizations credentials */
|
|
@@ -20,27 +91,34 @@ export type PartyMetadata = {
|
|
|
20
91
|
};
|
|
21
92
|
|
|
22
93
|
/** An Organization Site */
|
|
23
|
-
export type PartySite = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
end_date: string;
|
|
27
|
-
active: boolean;
|
|
28
|
-
party_id: string;
|
|
29
|
-
location_number: number;
|
|
94
|
+
export type PartySite = CommonFields<never> & {
|
|
95
|
+
party_id: PRid;
|
|
96
|
+
location_id: number;
|
|
30
97
|
party_site_name: string;
|
|
31
98
|
party_site_description: string | null;
|
|
32
|
-
party_site_number: string | null;
|
|
33
99
|
party_uses: string[];
|
|
34
100
|
party_use_primary: string;
|
|
35
|
-
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type CustomerSite = CommonFields<never> & {
|
|
104
|
+
org_id: OId;
|
|
105
|
+
party_site_id: string;
|
|
106
|
+
customer_site_code: string;
|
|
107
|
+
customer_site_status_code: string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export type CustomerSiteUse = CommonFields<never> & {
|
|
111
|
+
org_id: OId;
|
|
112
|
+
customer_site_id: string;
|
|
113
|
+
customer_site_use_purpose_code: string;
|
|
114
|
+
customer_site_use_name: string;
|
|
115
|
+
freight_term_code: string | null;
|
|
116
|
+
payment_term_id: string;
|
|
117
|
+
price_list_version_id: string | null;
|
|
36
118
|
};
|
|
37
119
|
|
|
38
120
|
/** An Organization Location */
|
|
39
|
-
export type Location = {
|
|
40
|
-
id: string;
|
|
41
|
-
start_date: string;
|
|
42
|
-
end_date: string;
|
|
43
|
-
active: boolean;
|
|
121
|
+
export type Location = CommonFields<LOCId> & {
|
|
44
122
|
location_name: string;
|
|
45
123
|
location_description: string | null;
|
|
46
124
|
address_line_1: string | null;
|
|
@@ -62,16 +140,11 @@ export type Location = {
|
|
|
62
140
|
country: string | null;
|
|
63
141
|
geolocation: string | null;
|
|
64
142
|
geolocation_outline: string | null;
|
|
65
|
-
metadata: unknown;
|
|
66
143
|
};
|
|
67
144
|
|
|
68
145
|
/** A Contact Point for an Organization */
|
|
69
|
-
export type ContactPoint = {
|
|
70
|
-
|
|
71
|
-
start_date: string;
|
|
72
|
-
end_date: string;
|
|
73
|
-
active: boolean;
|
|
74
|
-
to_table: string;
|
|
146
|
+
export type ContactPoint = CommonFields<PCId> & {
|
|
147
|
+
party_id: PRid;
|
|
75
148
|
uuid: string | undefined;
|
|
76
149
|
contact_point_purpose: string;
|
|
77
150
|
contact_point_type: string;
|
|
@@ -82,5 +155,4 @@ export type ContactPoint = {
|
|
|
82
155
|
url_type: string | null;
|
|
83
156
|
email_address: string;
|
|
84
157
|
email_address_preferred_format: string;
|
|
85
|
-
metadata: unknown;
|
|
86
158
|
};
|
package/src/raytio.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Encrypted } from "./crypto";
|
|
2
|
-
import { Colors, CustomFonts } from "./theme";
|
|
1
|
+
import type { Encrypted } from "./crypto";
|
|
2
|
+
import type { Colors, CustomFonts } from "./theme";
|
|
3
3
|
|
|
4
4
|
/** @internal see Microsoft/TypeScript#202 */
|
|
5
5
|
export type StringWithIdentity<T> = string & { $$typeof$$: T };
|
|
6
6
|
|
|
7
7
|
/** @internal */
|
|
8
|
-
type Json = Record<string, any>; // TODO: (semver breaking) unknown
|
|
8
|
+
export type Json = Record<string, any>; // TODO: (semver breaking) unknown
|
|
9
9
|
|
|
10
10
|
/** A `p_id` is the ID of a {@link Relationship} */
|
|
11
11
|
export type PId = StringWithIdentity<"PId">;
|
|
@@ -13,18 +13,60 @@ export type PId = StringWithIdentity<"PId">;
|
|
|
13
13
|
export type IId = StringWithIdentity<"IId">;
|
|
14
14
|
/** An `n_id` is the ID of a {@link ProfileObject} */
|
|
15
15
|
export type NId = StringWithIdentity<"NId">;
|
|
16
|
+
/** ⚠️ This ID duplicates the {@link NId} and should only be used in exceptional circumstances */
|
|
17
|
+
export type NId2 = StringWithIdentity<"NId2">;
|
|
16
18
|
/** A `g_id` is the ID of a group */
|
|
17
19
|
export type GId = StringWithIdentity<"GId">;
|
|
18
20
|
/** A `u_id` is the ID of a user */
|
|
19
21
|
export type UId = StringWithIdentity<"UId">;
|
|
20
22
|
/** An `a_id` is the ID of an {@link AA} */
|
|
21
23
|
export type AId = StringWithIdentity<"AId">;
|
|
22
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* An `o_id` is the ID of an {@link Organization}
|
|
26
|
+
*
|
|
27
|
+
* NOTE: Will be deprecated soon. Use CId instead.
|
|
28
|
+
* */
|
|
23
29
|
export type OId = StringWithIdentity<"OId">;
|
|
30
|
+
/** A `pr_id` is the ID of a {@link Party} */
|
|
31
|
+
export type PRid = StringWithIdentity<"PRid">;
|
|
32
|
+
/** A `pc_id` is the ID of a Party Contact Point */
|
|
33
|
+
export type PCId = StringWithIdentity<"PCId">;
|
|
24
34
|
/** A `wi_id` is the ID of a {@link Webhook} */
|
|
25
35
|
export type WId = StringWithIdentity<"WId">;
|
|
26
36
|
/** An `l_id` is the ID of any data stored in the KV-Store */ // e.g. StoredWizardConfig and VerBundleMetadata
|
|
27
37
|
export type LId = StringWithIdentity<"LId">;
|
|
38
|
+
/** A `k_id` (also called a `aack_id` or a `publicKeyId`) is the ID of an AA's public key */
|
|
39
|
+
export type KId = StringWithIdentity<"KId">;
|
|
40
|
+
/** A `pk_id` is the ID of an AA's private key */
|
|
41
|
+
export type PKId = StringWithIdentity<"PKId">;
|
|
42
|
+
/** A `c_id` is the ID of a {@link Customer}, (will eventually replace org_id) */
|
|
43
|
+
export type CId = StringWithIdentity<"CId">;
|
|
44
|
+
/** A `t_id` is the ID of a transaction */
|
|
45
|
+
export type TId = StringWithIdentity<"TId">;
|
|
46
|
+
/** A `ws_id` is the ID of a transition */
|
|
47
|
+
export type WSId = StringWithIdentity<"WSId">;
|
|
48
|
+
/** A `SchemaName` is the ID of a {@link Schema} */
|
|
49
|
+
export type SchemaName = StringWithIdentity<"SchemaName">;
|
|
50
|
+
/** A `loc_id` is the ID of a location */
|
|
51
|
+
export type LOCId = StringWithIdentity<"LOCId">;
|
|
52
|
+
/** A `pl_id` is the ID of a PriceList */
|
|
53
|
+
export type PLId = StringWithIdentity<"PLId">;
|
|
54
|
+
/** A `prc_id` is the ID of a Price */
|
|
55
|
+
export type PRCId = StringWithIdentity<"PRCId">;
|
|
56
|
+
/** A `pll_id` is the ID of a PriceListLine/Plan */
|
|
57
|
+
export type PLLId = StringWithIdentity<"PLLId">;
|
|
58
|
+
/** A `s_id` is the ID of a Subscription */
|
|
59
|
+
export type SId = StringWithIdentity<"SId">;
|
|
60
|
+
/** A `sl_id` is the ID of a SubscriptionLine */
|
|
61
|
+
export type SLId = StringWithIdentity<"SLId">;
|
|
62
|
+
/** A `pm_id` is the ID of a PaymentMethod */
|
|
63
|
+
export type PMId = StringWithIdentity<"PMId">;
|
|
64
|
+
/** A `pt_id` is the ID of a PaymentProcessor */
|
|
65
|
+
export type PTId = StringWithIdentity<"PTId">;
|
|
66
|
+
/** A `m_id` is the ID of a Merchant */
|
|
67
|
+
export type MId = StringWithIdentity<"MId">;
|
|
68
|
+
/** A `gpm_id` is the ID of a Verification Type */
|
|
69
|
+
export type GPMId = StringWithIdentity<"GPMId">;
|
|
28
70
|
|
|
29
71
|
export type DataTypes =
|
|
30
72
|
| "string"
|
|
@@ -45,8 +87,40 @@ export type SubmissionStatus =
|
|
|
45
87
|
| "Received"
|
|
46
88
|
| "Accepted";
|
|
47
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Every object in the new database has these fields. In the
|
|
92
|
+
* interest of type-safety, the `id` should be one of the
|
|
93
|
+
* well-known IDs that extend {@link StringWithIdentity} (e.g.
|
|
94
|
+
* {@link NId} or {@link AId}). If the ID is irrelevant, then
|
|
95
|
+
* use `CommonFields<never>` rather than `CommonFields<string>`.
|
|
96
|
+
* This will deliberately prevent you from utilising the `id`
|
|
97
|
+
* field until you define a special type for that ID.
|
|
98
|
+
*
|
|
99
|
+
* This is especially important with the new API where it is much
|
|
100
|
+
* easier to mix up the different types of IDs.
|
|
101
|
+
*/
|
|
102
|
+
export type CommonFields<
|
|
103
|
+
IdType extends StringWithIdentity<string>,
|
|
104
|
+
Metadata = unknown,
|
|
105
|
+
> = {
|
|
106
|
+
id: IdType;
|
|
107
|
+
/** ISO Date */
|
|
108
|
+
start_date: string;
|
|
109
|
+
/** ISO Date */
|
|
110
|
+
end_date: string;
|
|
111
|
+
active: boolean;
|
|
112
|
+
metadata: Metadata | undefined;
|
|
113
|
+
row_version?: number;
|
|
114
|
+
resource_group?: string;
|
|
115
|
+
resource_name?: string;
|
|
116
|
+
resource_url?: string;
|
|
117
|
+
tenant_id?: string;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export type PermissionType = "ADMINS" | "VIEWS" | "EDITS" | "OWNS";
|
|
121
|
+
|
|
48
122
|
/** You can supply an option type argument if you know exactly what the properties will be */
|
|
49
|
-
export type ProfileObject<Properties = Json> = {
|
|
123
|
+
export type ProfileObject<Properties = Json> = Partial<CommonFields<NId2>> & {
|
|
50
124
|
n_id: NId;
|
|
51
125
|
properties: Properties;
|
|
52
126
|
labels: string[];
|
|
@@ -70,7 +144,7 @@ export type ProfileObjectForUpload<Properties = Json> = {
|
|
|
70
144
|
|
|
71
145
|
// TODO: represent the below constraint in the typedef
|
|
72
146
|
// `schema` XOR `n_id` depending on whether creating or updating
|
|
73
|
-
schema?:
|
|
147
|
+
schema?: SchemaName; // only if creating a new PO
|
|
74
148
|
n_id?: NId; // only if editing an existing PO
|
|
75
149
|
};
|
|
76
150
|
|
|
@@ -88,9 +162,11 @@ export type Urn =
|
|
|
88
162
|
| `urn:profile_object:${NId}`
|
|
89
163
|
| `urn:instance:${IId}`
|
|
90
164
|
| `urn:temp_object:${LId}`
|
|
91
|
-
| `urn:schema:${
|
|
165
|
+
| `urn:schema:${SchemaName}`
|
|
92
166
|
| `urn:document:${NId}`;
|
|
93
167
|
|
|
168
|
+
export type ContentUrl = `url:${string}`;
|
|
169
|
+
|
|
94
170
|
export type Relationship = {
|
|
95
171
|
start: Urn;
|
|
96
172
|
end: Urn;
|
|
@@ -101,6 +177,9 @@ export type Relationship = {
|
|
|
101
177
|
name?: string;
|
|
102
178
|
[fieldName: string]: unknown;
|
|
103
179
|
};
|
|
180
|
+
start_date?: string;
|
|
181
|
+
end_date?: string;
|
|
182
|
+
active?: boolean;
|
|
104
183
|
};
|
|
105
184
|
|
|
106
185
|
export type Lookup = {
|
|
@@ -144,7 +223,8 @@ export type AA = {
|
|
|
144
223
|
/** the n_id of the associated service provider */
|
|
145
224
|
service_provider_n_id?: NId;
|
|
146
225
|
/** the id of the associated organization */
|
|
147
|
-
org_id
|
|
226
|
+
org_id?: OId;
|
|
227
|
+
customer_id: CId;
|
|
148
228
|
|
|
149
229
|
/** configuration for the submission rules */
|
|
150
230
|
// we know the type should be `ScoreConfig`, but we can't rely that it's valid, or the right version
|
|
@@ -162,17 +242,15 @@ export type AA = {
|
|
|
162
242
|
metadata?: unknown;
|
|
163
243
|
secret?: unknown;
|
|
164
244
|
|
|
165
|
-
/** @internal */
|
|
245
|
+
/** @internal fetched separately (see #1511) */
|
|
166
246
|
transitions?: unknown[];
|
|
167
247
|
};
|
|
168
248
|
|
|
169
|
-
export type
|
|
170
|
-
/** Access application instance ID */
|
|
171
|
-
i_id: IId;
|
|
249
|
+
export type InstanceWithoutData = CommonFields<IId, { message?: string }> & {
|
|
172
250
|
/** ID of the access application this submission was made to */
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
|
|
251
|
+
aa_id: AId;
|
|
252
|
+
/** ID of the public key for this AA */
|
|
253
|
+
aack_id: KId;
|
|
176
254
|
/** Code that validates information has been shared */
|
|
177
255
|
confirmation_code: string;
|
|
178
256
|
/** reference provided by the user who shared the data */
|
|
@@ -180,31 +258,12 @@ export type Instance = {
|
|
|
180
258
|
/** Email of user who shared the data */
|
|
181
259
|
data_provider_email: string;
|
|
182
260
|
thread: string;
|
|
183
|
-
/** Latest date in which the shared information was available */
|
|
184
|
-
end_date: string;
|
|
185
|
-
/** Earliest date on which the shared information was available */
|
|
186
|
-
start_date: string;
|
|
187
261
|
/** The status of a submission */
|
|
188
262
|
state: SubmissionStatus;
|
|
189
|
-
/** @deprecated The status of a submission */
|
|
190
|
-
_state?: SubmissionStatus;
|
|
191
|
-
|
|
192
263
|
/** Hash of the Service Provider ID */
|
|
193
|
-
sub_service_provider_hash
|
|
264
|
+
sub_service_provider_hash: string;
|
|
194
265
|
/** Service provider ID */
|
|
195
|
-
service_provider_n_id
|
|
196
|
-
/** data associated is access application's instance */
|
|
197
|
-
profile_objects: ProfileObject[];
|
|
198
|
-
// TODO: (semver breaking) mark as optional since the get-shared-data API doesn't return keys
|
|
199
|
-
keys: {
|
|
200
|
-
[nId: NId]: {
|
|
201
|
-
[fieldName: string]: {
|
|
202
|
-
data: string;
|
|
203
|
-
n_id: NId;
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
relationships?: Relationship[];
|
|
266
|
+
service_provider_n_id: NId;
|
|
208
267
|
|
|
209
268
|
/** added by the client once it calculates the score */
|
|
210
269
|
// Defined as `unknown` instead of `ScoreResult` because it could be nonsense,
|
|
@@ -226,34 +285,23 @@ export type Instance = {
|
|
|
226
285
|
platform_footer_html?: unknown;
|
|
227
286
|
/** Related Service Types */
|
|
228
287
|
related_service_types?: unknown;
|
|
229
|
-
/** Activity Status */
|
|
230
|
-
active?: boolean;
|
|
231
|
-
/** Key (Can be used to retrieve instance) */
|
|
232
|
-
aack_id?: string;
|
|
233
|
-
/** Metadata */
|
|
234
|
-
metadata?: unknown;
|
|
235
288
|
};
|
|
236
289
|
|
|
237
290
|
/**
|
|
238
|
-
*
|
|
239
|
-
*
|
|
291
|
+
* The API used to store data in this format, but it no
|
|
292
|
+
* longer does :( so `@raytio/core` reconstructs this object.
|
|
240
293
|
*/
|
|
241
|
-
export type
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
organization: Omit<Organization, "id">;
|
|
253
|
-
/** 🧙♂️ */
|
|
254
|
-
gandalf: unknown;
|
|
255
|
-
stripe: { customer: unknown };
|
|
256
|
-
centrix_credentials: unknown;
|
|
294
|
+
export type Instance = InstanceWithoutData & {
|
|
295
|
+
profile_objects: ProfileObject[];
|
|
296
|
+
keys: {
|
|
297
|
+
// this is no longer keyed by the nId,
|
|
298
|
+
[nId2: NId2]: {
|
|
299
|
+
[fieldName: string]: {
|
|
300
|
+
data: string;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
relationships: Relationship[];
|
|
257
305
|
};
|
|
258
306
|
|
|
259
307
|
/** validation data returned by preVerify (part of the extract&map API) */
|
|
@@ -309,3 +357,17 @@ export type Webhook = {
|
|
|
309
357
|
response_payload: Json;
|
|
310
358
|
}[];
|
|
311
359
|
};
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Link used for an Access Application, including all additional information
|
|
363
|
+
*/
|
|
364
|
+
export type Link = {
|
|
365
|
+
id: NId;
|
|
366
|
+
a_id: AId;
|
|
367
|
+
name: string;
|
|
368
|
+
subtitle: string;
|
|
369
|
+
code: LId;
|
|
370
|
+
url: string;
|
|
371
|
+
details?: AA;
|
|
372
|
+
isDefault?: boolean;
|
|
373
|
+
};
|