@andco/protocol 0.0.10 → 0.0.12

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 (120) hide show
  1. package/dist/api-errors.d.ts +5 -128
  2. package/dist/api-errors.d.ts.map +1 -1
  3. package/dist/api-errors.js +5 -131
  4. package/dist/authorization-preparation.d.ts +3 -3
  5. package/dist/authorization-preparation.d.ts.map +1 -1
  6. package/dist/authorization-preparation.js +4 -0
  7. package/dist/authorization.js +2 -2
  8. package/dist/errors.d.ts +60 -16
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/errors.js +60 -12
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/intent-input.d.ts +1791 -725
  15. package/dist/intent-input.d.ts.map +1 -1
  16. package/dist/intent-input.js +325 -157
  17. package/dist/issues.d.ts +61 -0
  18. package/dist/issues.d.ts.map +1 -0
  19. package/dist/issues.js +61 -0
  20. package/dist/messages/index.d.ts +2 -2
  21. package/dist/messages/index.d.ts.map +1 -1
  22. package/dist/messages/index.js +10 -3
  23. package/dist/messages/set-preferences.d.ts +13 -1
  24. package/dist/messages/set-preferences.d.ts.map +1 -1
  25. package/dist/messages/set-preferences.js +31 -9
  26. package/dist/miniapp-manifest.d.ts +2 -2
  27. package/dist/miniapp-manifest.d.ts.map +1 -1
  28. package/dist/miniapp-manifest.js +1 -1
  29. package/dist/native-intent.d.ts +48 -28
  30. package/dist/native-intent.d.ts.map +1 -1
  31. package/dist/native-intent.js +76 -24
  32. package/dist/pagination.d.ts +37 -31
  33. package/dist/pagination.d.ts.map +1 -1
  34. package/dist/pagination.js +72 -24
  35. package/dist/rar/account-matchers.d.ts +47 -240
  36. package/dist/rar/account-matchers.d.ts.map +1 -1
  37. package/dist/rar/account-matchers.js +52 -131
  38. package/dist/rar/bank.d.ts +280 -392
  39. package/dist/rar/bank.d.ts.map +1 -1
  40. package/dist/rar/bank.js +68 -137
  41. package/dist/rar/catalog.d.ts +305 -288
  42. package/dist/rar/catalog.d.ts.map +1 -1
  43. package/dist/rar/catalog.js +69 -29
  44. package/dist/rar/detail.d.ts +15 -32
  45. package/dist/rar/detail.d.ts.map +1 -1
  46. package/dist/rar/detail.js +14 -34
  47. package/dist/rar/index.d.ts +2 -1
  48. package/dist/rar/index.d.ts.map +1 -1
  49. package/dist/rar/index.js +2 -1
  50. package/dist/rar/json-schemas.generated.d.ts +4 -0
  51. package/dist/rar/json-schemas.generated.d.ts.map +1 -0
  52. package/dist/rar/json-schemas.generated.js +3570 -0
  53. package/dist/rar/money.d.ts +5 -5
  54. package/dist/rar/money.d.ts.map +1 -1
  55. package/dist/rar/money.js +5 -5
  56. package/dist/rar/project-users.d.ts +40 -14
  57. package/dist/rar/project-users.d.ts.map +1 -1
  58. package/dist/rar/project-users.js +20 -23
  59. package/dist/rar/subject-data.d.ts +96 -48
  60. package/dist/rar/subject-data.d.ts.map +1 -1
  61. package/dist/rar/subject-data.js +61 -34
  62. package/dist/rar/subject.d.ts +18 -85
  63. package/dist/rar/subject.d.ts.map +1 -1
  64. package/dist/rar/subject.js +23 -51
  65. package/dist/rest/accounts.d.ts +347 -0
  66. package/dist/rest/accounts.d.ts.map +1 -0
  67. package/dist/rest/accounts.js +108 -0
  68. package/dist/rest/addresses.d.ts +581 -0
  69. package/dist/rest/addresses.d.ts.map +1 -0
  70. package/dist/rest/addresses.js +190 -0
  71. package/dist/rest/api-error.d.ts +104 -0
  72. package/dist/rest/api-error.d.ts.map +1 -0
  73. package/dist/rest/api-error.js +103 -0
  74. package/dist/rest/authorization.d.ts +123 -0
  75. package/dist/rest/authorization.d.ts.map +1 -0
  76. package/dist/rest/authorization.js +62 -0
  77. package/dist/rest/catalog.d.ts +199 -0
  78. package/dist/rest/catalog.d.ts.map +1 -0
  79. package/dist/rest/catalog.js +63 -0
  80. package/dist/rest/common.d.ts +637 -0
  81. package/dist/rest/common.d.ts.map +1 -0
  82. package/dist/rest/common.js +172 -0
  83. package/dist/rest/contract.d.ts +3480 -0
  84. package/dist/rest/contract.d.ts.map +1 -0
  85. package/dist/rest/contract.js +120 -0
  86. package/dist/rest/events.d.ts +145 -0
  87. package/dist/rest/events.d.ts.map +1 -0
  88. package/dist/rest/events.js +42 -0
  89. package/dist/rest/http.d.ts +49 -0
  90. package/dist/rest/http.d.ts.map +1 -0
  91. package/dist/rest/http.js +25 -0
  92. package/dist/rest/identity.d.ts +627 -0
  93. package/dist/rest/identity.d.ts.map +1 -0
  94. package/dist/rest/identity.js +128 -0
  95. package/dist/rest/index.d.ts +14 -0
  96. package/dist/rest/index.d.ts.map +1 -0
  97. package/dist/rest/index.js +13 -0
  98. package/dist/rest/intents.d.ts +4556 -0
  99. package/dist/rest/intents.d.ts.map +1 -0
  100. package/dist/rest/intents.js +551 -0
  101. package/dist/rest/signatures.d.ts +110 -0
  102. package/dist/rest/signatures.d.ts.map +1 -0
  103. package/dist/rest/signatures.js +113 -0
  104. package/dist/rest/subjects.d.ts +14 -0
  105. package/dist/rest/subjects.d.ts.map +1 -0
  106. package/dist/rest/subjects.js +22 -0
  107. package/dist/service-grants.d.ts +2 -2
  108. package/dist/service-grants.d.ts.map +1 -1
  109. package/dist/service-grants.js +1 -1
  110. package/dist/transport/generated/oauth-api.d.ts +5547 -1448
  111. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  112. package/dist/transport/intents.d.ts +9 -134
  113. package/dist/transport/intents.d.ts.map +1 -1
  114. package/dist/transport/intents.js +21 -405
  115. package/dist/transport/rest.d.ts +15 -5
  116. package/dist/transport/rest.d.ts.map +1 -1
  117. package/dist/userinfo.d.ts +22 -9
  118. package/dist/userinfo.d.ts.map +1 -1
  119. package/dist/userinfo.js +17 -12
  120. package/package.json +13 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/rest/identity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;A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AA6D;AAC7D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sTAaV,CAAC;AAE5B,gDAAgD;AAChD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sTAaJ,CAAC;AAEpC,oEAAoE;AACpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+QAqCH,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { oc } from "@orpc/contract";
2
+ import * as v from "valibot";
3
+ import { UserInfo } from "../userinfo.js";
4
+ import { Address } from "./addresses.js";
5
+ import { errors } from "./api-error.js";
6
+ import { connection, InsufficientAuthorization, InsufficientScope, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, PageQuery, ServerError, TemporarilyUnavailable, UnsupportedVersion, } from "./common.js";
7
+ import { http } from "./http.js";
8
+ import { OrganizationIdParameter, ProfileIdParameter, SubjectErrors } from "./subjects.js";
9
+ /** What Andco Core checked about an identity's document, and when. */
10
+ export const IdentityValidation = /* @__PURE__ */ v.pipe(v.object({
11
+ validated_by: v.pipe(v.picklist(["andco_core"]), v.description("Who validated the identity. `andco_core` is Andco Core, on its hosted page.")),
12
+ validated_at: v.pipe(v.string(), v.isoTimestamp()),
13
+ evidence: v.pipe(v.pipe(v.array(v.picklist(["document", "liveness", "face_comparison"])), v.minLength(1)), v.description("The kinds of evidence, named after the `evidence` of `verified_claims` in OpenID Connect for Identity Assurance.")),
14
+ verification_id: v.pipe(v.pipe(v.string(), v.uuid()), v.description("Andco Core's identifier of the validation. Keep it as the reference to the validation.")),
15
+ }), v.description("What Andco Core checked about the identity's document. It belongs to the document (country, kind and number), so correcting the number voids it and correcting the names does not. It does not expire; the reader decides how old a validation it accepts."));
16
+ /** A person's identity: who they are by their document. */
17
+ export const ProfileIdentity = /* @__PURE__ */ v.object({
18
+ id: v.pipe(v.string(), v.uuid()),
19
+ country: v.string(),
20
+ nationality: v.nullable(v.string()),
21
+ born_date: v.nullable(v.pipe(v.string(), v.isoDate())),
22
+ gender: v.nullable(v.picklist(["male", "female", "other"])),
23
+ document_kind: v.picklist(["nin", "passport"]),
24
+ document_value: v.string(),
25
+ given_names: v.nullable(v.string()),
26
+ family_names: v.nullable(v.string()),
27
+ business_activity_code: v.nullable(v.string()),
28
+ validation: v.pipe(v.optional(v.nullable(IdentityValidation)), v.description("Only on `GET /profiles/{profile_id}/identities`, and only when the Grant's `identity` detail asked for it with `validation` and `required` true; a plain `identity` read does not get the field, not even `null`. `null` means this identity has no validation.")),
29
+ });
30
+ /** One page of a Profile's identities. */
31
+ export const ProfileIdentityPage = /* @__PURE__ */ connection(ProfileIdentity, "A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes.");
32
+ /** The legal identity of an Organization: its name and its tax document. */
33
+ export const OrganizationIdentity = /* @__PURE__ */ v.object({
34
+ id: v.pipe(v.string(), v.uuid()),
35
+ legal_name: v.string(),
36
+ country: v.string(),
37
+ document_kind: v.literal("rut"),
38
+ document_value: v.string(),
39
+ });
40
+ /** One page of an Organization's legal identities. */
41
+ export const OrganizationIdentityPage = /* @__PURE__ */ connection(OrganizationIdentity, "A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes.");
42
+ /** An Organization a Profile belongs to, by name. */
43
+ export const Organization = /* @__PURE__ */ v.object({
44
+ id: v.pipe(v.string(), v.regex(/^[1-9][0-9]*$/)),
45
+ name: v.string(),
46
+ });
47
+ /** One page of Organizations. */
48
+ export const OrganizationPage = /* @__PURE__ */ connection(Organization, "A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes.");
49
+ /**
50
+ * A person who uses a Project's Clients. Every field is present; one is `null` when the person did
51
+ * not disclose it or the Grant and the request leave it out.
52
+ */
53
+ export const ProjectProfile = /* @__PURE__ */ v.object({
54
+ id: v.pipe(v.string(), v.uuid()),
55
+ name: v.nullable(v.string()),
56
+ email: v.nullable(v.string()),
57
+ avatar: v.nullable(v.pipe(v.string(), v.url())),
58
+ phone: v.nullable(v.string()),
59
+ identities: v.nullable(v.array(ProfileIdentity)),
60
+ addresses: v.nullable(v.array(Address)),
61
+ });
62
+ /** One page of a Project's Profiles. */
63
+ export const ProjectProfilePage = /* @__PURE__ */ connection(ProjectProfile, "A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes.");
64
+ /** The Project whose Profiles are read, in `/projects/{project_id}/profiles`. */
65
+ const ProjectIdParameter = /* @__PURE__ */ v.pipe(v.pipe(v.string(), v.uuid()), v.description("The Project whose Profiles are read; it must be one of the Grant's `project_ids`, or any of the Organization's when that list is empty."));
66
+ /** Reads the standard identity claims of the person the token was issued to. */
67
+ export const getUserInfo = /* @__PURE__ */ oc
68
+ .meta(http({
69
+ method: "GET",
70
+ path: "/userinfo",
71
+ summary: "Get the authenticated user's standard identity claims",
72
+ successDescription: "Scope-filtered OpenID-style claims",
73
+ }))
74
+ .errors(errors(InvalidToken, InsufficientScope, InvalidOrigin, UnsupportedVersion, ServerError, TemporarilyUnavailable))
75
+ .output(UserInfo);
76
+ /** Lists a Profile's active identities. */
77
+ export const listProfileIdentities = /* @__PURE__ */ oc
78
+ .meta(http({
79
+ method: "GET",
80
+ path: "/profiles/{profile_id}/identities",
81
+ summary: "List a Profile's identities",
82
+ description: "Granted by an `identity` authorization detail with `read` whose subject is this Profile. A subject that is not the Grant's answers `404`, as one that does not exist. Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed. When the Grant's detail asked for the Validación de identidad (`validation` with `required` true), each identity also carries `validation`; without it the field is absent, not `null`.",
83
+ successDescription: "One page of the Profile's active identities",
84
+ }))
85
+ .errors(errors(...SubjectErrors, InvalidRequest))
86
+ .input(v.object({ profile_id: ProfileIdParameter, ...PageQuery }))
87
+ .output(ProfileIdentityPage);
88
+ /** Lists the Organizations a Profile belongs to, by name. */
89
+ export const listProfileOrganizations = /* @__PURE__ */ oc
90
+ .meta(http({
91
+ method: "GET",
92
+ path: "/profiles/{profile_id}/organizations",
93
+ summary: "List the Organizations a Profile belongs to",
94
+ description: "Granted by an `organization` authorization detail with `list` whose subject is this Profile. It names each Organization and grants no access to its data: ask for an Organization subject to read it. Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed.",
95
+ successDescription: "The Profile's Organizations, by name",
96
+ }))
97
+ .errors(errors(...SubjectErrors, InvalidRequest))
98
+ .input(v.object({ profile_id: ProfileIdParameter, ...PageQuery }))
99
+ .output(OrganizationPage);
100
+ /** Lists an Organization's legal identities. */
101
+ export const listOrganizationIdentities = /* @__PURE__ */ oc
102
+ .meta(http({
103
+ method: "GET",
104
+ path: "/organizations/{organization_id}/identities",
105
+ summary: "List an Organization's legal identities",
106
+ description: "Granted by an `identity` authorization detail with `read` whose subject is this Organization. Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed.",
107
+ successDescription: "The Organization's legal identities",
108
+ }))
109
+ .errors(errors(...SubjectErrors, InvalidRequest))
110
+ .input(v.object({ organization_id: OrganizationIdParameter, ...PageQuery }))
111
+ .output(OrganizationIdentityPage);
112
+ /** Lists the Profiles of the people who use a Project's Clients. */
113
+ export const listProjectProfiles = /* @__PURE__ */ oc
114
+ .meta(http({
115
+ method: "GET",
116
+ path: "/projects/{project_id}/profiles",
117
+ summary: "Read the Profiles of the people who use a Project's Clients",
118
+ description: "Granted by a `project_users` authorization detail with `read`, held by a Service. Its empty `project_ids`, `client_ids` and `fields` mean all, and the `client_id` and `fields` query parameters can only narrow them. Every field is present in each item; one is null when the person did not disclose it through their consent (`profile` discloses the name and avatar, `email` the email, `phone` the phone, an `identity` or `address` read Grant the identities or addresses) or when the Grant and the request leave it out. Cursor authority is pinned to one exact Grant, Project and filter. Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed.",
119
+ successDescription: "One cursor page of the Project's Profiles",
120
+ }))
121
+ .errors(errors(InvalidIdentifier, InvalidRequest, InvalidToken, InsufficientAuthorization, InvalidOrigin, UnsupportedVersion, ServerError, TemporarilyUnavailable))
122
+ .input(v.object({
123
+ project_id: ProjectIdParameter,
124
+ client_id: v.pipe(v.optional(v.string()), v.description("An eq.UUID or in.(UUID,UUID) filter that narrows the authorized Clients.")),
125
+ fields: v.pipe(v.optional(v.string()), v.description("A comma-separated subset of the fields the Grant allows, for example `name,email`.")),
126
+ ...PageQuery,
127
+ }))
128
+ .output(ProjectProfilePage);
@@ -0,0 +1,14 @@
1
+ export * from "./accounts.js";
2
+ export * from "./addresses.js";
3
+ export * from "./api-error.js";
4
+ export * from "./authorization.js";
5
+ export * from "./catalog.js";
6
+ export * from "./common.js";
7
+ export * from "./contract.js";
8
+ export * from "./events.js";
9
+ export * from "./http.js";
10
+ export * from "./identity.js";
11
+ export * from "./intents.js";
12
+ export * from "./signatures.js";
13
+ export * from "./subjects.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rest/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from "./accounts.js";
2
+ export * from "./addresses.js";
3
+ export * from "./api-error.js";
4
+ export * from "./authorization.js";
5
+ export * from "./catalog.js";
6
+ export * from "./common.js";
7
+ export * from "./contract.js";
8
+ export * from "./events.js";
9
+ export * from "./http.js";
10
+ export * from "./identity.js";
11
+ export * from "./intents.js";
12
+ export * from "./signatures.js";
13
+ export * from "./subjects.js";