@proveanything/smartlinks 2.1.46 → 2.1.47
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/dist/api/dpp.d.ts +93 -0
- package/dist/api/dpp.js +182 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/docs/API_SUMMARY.md +318 -1
- package/dist/docs/dpp.md +99 -0
- package/dist/docs/overview.md +1 -0
- package/dist/openapi.yaml +503 -0
- package/dist/types/dpp.d.ts +264 -0
- package/dist/types/dpp.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/docs/API_SUMMARY.md +318 -1
- package/docs/dpp.md +99 -0
- package/docs/overview.md +1 -0
- package/openapi.yaml +503 -0
- package/package.json +1 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/** The EU registry's environments: `acc` = the EU test registry, `prod` = the live one, `local` = a development stand-in. */
|
|
2
|
+
export type DppEnvironment = "acc" | "prod" | "local" | (string & {});
|
|
3
|
+
/** How specific a passport is: one item (e.g. one battery), a batch, or a model. */
|
|
4
|
+
export type DppGranularity = "item" | "batch" | "model";
|
|
5
|
+
/** What the admin still has to do to connect a brand to the registry, in order (null = connected). */
|
|
6
|
+
export type DppRegistryNextStep = "make-key" | "enter-service-account" | "enter-organisation-id" | "check" | null;
|
|
7
|
+
/** A brand's EU registry Service Account, as SmartLinks uses it. Never includes the private key. */
|
|
8
|
+
export interface DppRegistry {
|
|
9
|
+
environment: DppEnvironment;
|
|
10
|
+
/** e.g. "EU test registry" */
|
|
11
|
+
label: string;
|
|
12
|
+
/** The registry's web address, where the brand enrols and manages its Service Account. */
|
|
13
|
+
portal: string | null;
|
|
14
|
+
/** The Service Account's Client ID, from the registry. */
|
|
15
|
+
clientId: string | null;
|
|
16
|
+
/** The key ID (kid) the registry gave our public key. */
|
|
17
|
+
kid: string | null;
|
|
18
|
+
/** ES256 | ES384 | ES512 */
|
|
19
|
+
alg: string | null;
|
|
20
|
+
/** The brand's verified Organisation ID (registry: Organisation > Verification), copied exactly. */
|
|
21
|
+
orgIdentifier: string | null;
|
|
22
|
+
hasKey: boolean;
|
|
23
|
+
/** The public key to upload to the Service Account (PEM). */
|
|
24
|
+
publicPem: string | null;
|
|
25
|
+
/** The same public key as a JWK. */
|
|
26
|
+
publicJwk: {
|
|
27
|
+
kty: string;
|
|
28
|
+
crv: string;
|
|
29
|
+
x: string;
|
|
30
|
+
y: string;
|
|
31
|
+
} | null;
|
|
32
|
+
/** RFC 7638 thumbprint of the public key. */
|
|
33
|
+
thumbprint: string | null;
|
|
34
|
+
keyCreatedAt: string | null;
|
|
35
|
+
/** The last connection check: signed in and read the product groups, or why not. */
|
|
36
|
+
lastCheck: {
|
|
37
|
+
ok: boolean;
|
|
38
|
+
at: string;
|
|
39
|
+
message: string;
|
|
40
|
+
status?: number | null;
|
|
41
|
+
} | null;
|
|
42
|
+
/** Key, Service Account and Organisation ID all set. */
|
|
43
|
+
ready: boolean;
|
|
44
|
+
nextStep: DppRegistryNextStep;
|
|
45
|
+
}
|
|
46
|
+
export interface SetDppRegistryInput {
|
|
47
|
+
clientId?: string | null;
|
|
48
|
+
kid?: string | null;
|
|
49
|
+
orgIdentifier?: string | null;
|
|
50
|
+
}
|
|
51
|
+
/** A registry product group, from the registry itself. */
|
|
52
|
+
export interface DppRegistryProductGroup {
|
|
53
|
+
code: string;
|
|
54
|
+
label: string;
|
|
55
|
+
productSubGroups: {
|
|
56
|
+
code: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}[];
|
|
59
|
+
}
|
|
60
|
+
export interface DppRegistryCheckResult {
|
|
61
|
+
registry: DppRegistry;
|
|
62
|
+
productGroups: DppRegistryProductGroup[];
|
|
63
|
+
}
|
|
64
|
+
/** Field names per view: `pub` (anyone) and the restricted views `res1`–`res3`. */
|
|
65
|
+
export interface DppViewFields {
|
|
66
|
+
pub: string[];
|
|
67
|
+
res1: string[];
|
|
68
|
+
res2: string[];
|
|
69
|
+
res3: string[];
|
|
70
|
+
}
|
|
71
|
+
/** What can be made: a product group, its kinds, and their fields (from the Commission's schemas). */
|
|
72
|
+
export interface DppGroup {
|
|
73
|
+
/** e.g. "BATTERIES" */
|
|
74
|
+
productGroup: string;
|
|
75
|
+
/** e.g. "battery" */
|
|
76
|
+
label: string;
|
|
77
|
+
subGroups: {
|
|
78
|
+
/** e.g. "EV" */
|
|
79
|
+
productSubGroup: string;
|
|
80
|
+
/** e.g. "electric vehicle" */
|
|
81
|
+
label: string;
|
|
82
|
+
/** Every field each view may carry. */
|
|
83
|
+
fields: DppViewFields;
|
|
84
|
+
/** The fields each view must carry. */
|
|
85
|
+
required: DppViewFields;
|
|
86
|
+
}[];
|
|
87
|
+
}
|
|
88
|
+
/** What a passport is still missing before the registry will take it. */
|
|
89
|
+
export interface DppPassportCheck {
|
|
90
|
+
ready: boolean;
|
|
91
|
+
missing: Partial<DppViewFields>;
|
|
92
|
+
/** When the passport's classification itself is invalid. */
|
|
93
|
+
problem?: string;
|
|
94
|
+
}
|
|
95
|
+
/** A passport's registration in one registry environment. */
|
|
96
|
+
export interface DppRegistration {
|
|
97
|
+
/** processing → registered | rejected | not-sent (another item in the same request failed) | error */
|
|
98
|
+
status: "processing" | "registered" | "rejected" | "not-sent" | "error";
|
|
99
|
+
taskId?: string;
|
|
100
|
+
submittedAt?: string;
|
|
101
|
+
correlationId?: string | null;
|
|
102
|
+
/** The registry's unique registration identifier, once registered. */
|
|
103
|
+
registryId?: string | null;
|
|
104
|
+
registeredAt?: string;
|
|
105
|
+
problems?: {
|
|
106
|
+
code: string;
|
|
107
|
+
message: string;
|
|
108
|
+
}[] | null;
|
|
109
|
+
checkedAt?: string;
|
|
110
|
+
}
|
|
111
|
+
/** Fields of a passport, named as in the Commission's schemas (e.g. batteryChemistry, manufacturerIdentification). */
|
|
112
|
+
export type DppFields = Record<string, unknown>;
|
|
113
|
+
export interface DppPassport {
|
|
114
|
+
id: string;
|
|
115
|
+
/** Its address — the unique product identifier registered with the EU. */
|
|
116
|
+
url: string;
|
|
117
|
+
status: "active" | "withdrawn";
|
|
118
|
+
productGroup: string;
|
|
119
|
+
productSubGroup: string | null;
|
|
120
|
+
granularity: DppGranularity;
|
|
121
|
+
modelIdentifier: string | null;
|
|
122
|
+
batchIdentifier: string | null;
|
|
123
|
+
/** What it's for. */
|
|
124
|
+
productId: string | null;
|
|
125
|
+
batchId: string | null;
|
|
126
|
+
proofId: string | null;
|
|
127
|
+
/** The public view: anyone reading the passport sees these. */
|
|
128
|
+
public: DppFields;
|
|
129
|
+
/** The restricted views (res1–res3): served only to the EU registry for this brand. */
|
|
130
|
+
restricted: DppFields;
|
|
131
|
+
/** Goes up by one each time what it says changes. */
|
|
132
|
+
version: number;
|
|
133
|
+
contentUpdatedAt: string | null;
|
|
134
|
+
/** By registry environment. */
|
|
135
|
+
registration: Partial<Record<DppEnvironment, DppRegistration>>;
|
|
136
|
+
check: DppPassportCheck;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
}
|
|
140
|
+
/** A passport's content. productGroup and (for batteries) productSubGroup are required when making one. */
|
|
141
|
+
export interface DppPassportInput {
|
|
142
|
+
productGroup?: string;
|
|
143
|
+
productSubGroup?: string | null;
|
|
144
|
+
granularity?: DppGranularity;
|
|
145
|
+
modelIdentifier?: string | null;
|
|
146
|
+
batchIdentifier?: string | null;
|
|
147
|
+
productId?: string | null;
|
|
148
|
+
batchId?: string | null;
|
|
149
|
+
proofId?: string | null;
|
|
150
|
+
public?: DppFields | null;
|
|
151
|
+
restricted?: DppFields | null;
|
|
152
|
+
}
|
|
153
|
+
/** A passport saved by what it's for: at least one of productId, batchId, proofId. */
|
|
154
|
+
export interface DppPassportUpsertInput extends DppPassportInput {
|
|
155
|
+
productGroup: string;
|
|
156
|
+
granularity: DppGranularity;
|
|
157
|
+
}
|
|
158
|
+
export interface DppPassportSaveResult {
|
|
159
|
+
passport: DppPassport;
|
|
160
|
+
/** false when the content was the same as before (no new version). */
|
|
161
|
+
changed: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface DppPassportUpsertResult extends DppPassportSaveResult {
|
|
164
|
+
created: boolean;
|
|
165
|
+
}
|
|
166
|
+
export interface DppPassportBulkResult {
|
|
167
|
+
results: ({
|
|
168
|
+
index: number;
|
|
169
|
+
ok: true;
|
|
170
|
+
id: string;
|
|
171
|
+
url: string;
|
|
172
|
+
created: boolean;
|
|
173
|
+
changed: boolean;
|
|
174
|
+
version: number;
|
|
175
|
+
check: DppPassportCheck;
|
|
176
|
+
} | {
|
|
177
|
+
index: number;
|
|
178
|
+
ok: false;
|
|
179
|
+
errorCode: string;
|
|
180
|
+
errorText: string;
|
|
181
|
+
})[];
|
|
182
|
+
created: number;
|
|
183
|
+
changed: number;
|
|
184
|
+
unchanged: number;
|
|
185
|
+
failed: number;
|
|
186
|
+
}
|
|
187
|
+
export interface DppPassportVersion {
|
|
188
|
+
version: number;
|
|
189
|
+
savedAt: string;
|
|
190
|
+
savedBy: string | null;
|
|
191
|
+
}
|
|
192
|
+
export interface DppPassportListQuery {
|
|
193
|
+
productId?: string;
|
|
194
|
+
batchId?: string;
|
|
195
|
+
proofId?: string;
|
|
196
|
+
status?: "active" | "withdrawn";
|
|
197
|
+
limit?: number;
|
|
198
|
+
offset?: number;
|
|
199
|
+
}
|
|
200
|
+
export interface DppRegisterResult {
|
|
201
|
+
/** One registry request per product group (and kind), up to 100 passports each. */
|
|
202
|
+
tasks: {
|
|
203
|
+
taskId: string;
|
|
204
|
+
environment: DppEnvironment;
|
|
205
|
+
productGroup: string;
|
|
206
|
+
productSubGroup: string | null;
|
|
207
|
+
passportIds: string[];
|
|
208
|
+
/** ISO 8601 duration the registry estimated, e.g. "PT10S". */
|
|
209
|
+
estimated: string | null;
|
|
210
|
+
/** With `wait`: the outcome. */
|
|
211
|
+
status?: string;
|
|
212
|
+
outcome?: DppTaskOutcome | null;
|
|
213
|
+
passports?: ({
|
|
214
|
+
id: string;
|
|
215
|
+
} & Partial<DppRegistration>)[];
|
|
216
|
+
}[];
|
|
217
|
+
/** Not sent, and why (not found, withdrawn, already registered, missing required fields). */
|
|
218
|
+
skipped: {
|
|
219
|
+
id: string;
|
|
220
|
+
reason: string;
|
|
221
|
+
missing?: Partial<DppViewFields>;
|
|
222
|
+
registryId?: string;
|
|
223
|
+
}[];
|
|
224
|
+
}
|
|
225
|
+
export interface DppTaskOutcome {
|
|
226
|
+
outcomeResult: "SUCCEEDED" | "FAILED";
|
|
227
|
+
outcomeMessage?: {
|
|
228
|
+
code: string;
|
|
229
|
+
message: string;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export interface DppTask {
|
|
233
|
+
taskId: string;
|
|
234
|
+
environment: DppEnvironment;
|
|
235
|
+
/** PENDING | PROCESSING | COMPLETED | ERROR */
|
|
236
|
+
status: string | null;
|
|
237
|
+
outcome: DppTaskOutcome | null;
|
|
238
|
+
passportIds: string[];
|
|
239
|
+
createdAt: string;
|
|
240
|
+
checkedAt: string | null;
|
|
241
|
+
}
|
|
242
|
+
export interface DppTaskRefreshResult {
|
|
243
|
+
taskId: string;
|
|
244
|
+
status: string | null;
|
|
245
|
+
outcome: DppTaskOutcome | null;
|
|
246
|
+
processingInfo: {
|
|
247
|
+
submittedItems: number;
|
|
248
|
+
compliantItems: number;
|
|
249
|
+
nonCompliantItems: number;
|
|
250
|
+
} | null;
|
|
251
|
+
passports: ({
|
|
252
|
+
id: string;
|
|
253
|
+
} & Partial<DppRegistration>)[];
|
|
254
|
+
}
|
|
255
|
+
/** A passport document as served at its address, in the EU's JSON format. */
|
|
256
|
+
export interface DppDocument {
|
|
257
|
+
digitalProductPassportId: string;
|
|
258
|
+
uniqueProductIdentifier: string;
|
|
259
|
+
granularity: string;
|
|
260
|
+
dppStatus: string;
|
|
261
|
+
lastUpdate: string;
|
|
262
|
+
contentSpecificationIds: string[];
|
|
263
|
+
[field: string]: unknown;
|
|
264
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./broadcasts.js";
|
|
|
17
17
|
export * from "./segments.js";
|
|
18
18
|
export * from "./userGroups.js";
|
|
19
19
|
export * from "./serviceAccounts.js";
|
|
20
|
+
export * from "./dpp.js";
|
|
20
21
|
export * from "./operations.js";
|
|
21
22
|
export * from "./common.js";
|
|
22
23
|
export * from "./query.js";
|
package/dist/types/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./broadcasts.js";
|
|
|
19
19
|
export * from "./segments.js";
|
|
20
20
|
export * from "./userGroups.js";
|
|
21
21
|
export * from "./serviceAccounts.js";
|
|
22
|
+
export * from "./dpp.js";
|
|
22
23
|
export * from "./operations.js";
|
|
23
24
|
export * from "./common.js";
|
|
24
25
|
export * from "./query.js";
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.47 | Generated: 2026-11-23T16:17:31.480Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -148,6 +148,7 @@ The Smartlinks SDK is organized into the following namespaces:
|
|
|
148
148
|
- **conditions** - Functions for conditions operations
|
|
149
149
|
- **config** - Functions for config operations
|
|
150
150
|
- **containers** - Functions for containers operations
|
|
151
|
+
- **dpp** - Functions for dpp operations
|
|
151
152
|
- **errors** - Functions for errors operations
|
|
152
153
|
- **facets** - Functions for facets operations
|
|
153
154
|
- **files** - Functions for files operations
|
|
@@ -8104,6 +8105,257 @@ interface DeleteCrateResponse {
|
|
|
8104
8105
|
}
|
|
8105
8106
|
```
|
|
8106
8107
|
|
|
8108
|
+
### dpp
|
|
8109
|
+
|
|
8110
|
+
**DppRegistry** (interface)
|
|
8111
|
+
```typescript
|
|
8112
|
+
interface DppRegistry {
|
|
8113
|
+
environment: DppEnvironment
|
|
8114
|
+
label: string
|
|
8115
|
+
portal: string | null
|
|
8116
|
+
clientId: string | null
|
|
8117
|
+
kid: string | null
|
|
8118
|
+
alg: string | null
|
|
8119
|
+
orgIdentifier: string | null
|
|
8120
|
+
hasKey: boolean
|
|
8121
|
+
publicPem: string | null
|
|
8122
|
+
publicJwk: { kty: string; crv: string; x: string; y: string } | null
|
|
8123
|
+
thumbprint: string | null
|
|
8124
|
+
keyCreatedAt: string | null
|
|
8125
|
+
lastCheck: { ok: boolean; at: string; message: string; status?: number | null } | null
|
|
8126
|
+
ready: boolean
|
|
8127
|
+
nextStep: DppRegistryNextStep
|
|
8128
|
+
}
|
|
8129
|
+
```
|
|
8130
|
+
|
|
8131
|
+
**SetDppRegistryInput** (interface)
|
|
8132
|
+
```typescript
|
|
8133
|
+
interface SetDppRegistryInput {
|
|
8134
|
+
clientId?: string | null
|
|
8135
|
+
kid?: string | null
|
|
8136
|
+
orgIdentifier?: string | null
|
|
8137
|
+
}
|
|
8138
|
+
```
|
|
8139
|
+
|
|
8140
|
+
**DppRegistryProductGroup** (interface)
|
|
8141
|
+
```typescript
|
|
8142
|
+
interface DppRegistryProductGroup {
|
|
8143
|
+
code: string
|
|
8144
|
+
label: string
|
|
8145
|
+
productSubGroups: { code: string; label: string }[]
|
|
8146
|
+
}
|
|
8147
|
+
```
|
|
8148
|
+
|
|
8149
|
+
**DppRegistryCheckResult** (interface)
|
|
8150
|
+
```typescript
|
|
8151
|
+
interface DppRegistryCheckResult {
|
|
8152
|
+
registry: DppRegistry
|
|
8153
|
+
productGroups: DppRegistryProductGroup[]
|
|
8154
|
+
}
|
|
8155
|
+
```
|
|
8156
|
+
|
|
8157
|
+
**DppViewFields** (interface)
|
|
8158
|
+
```typescript
|
|
8159
|
+
interface DppViewFields {
|
|
8160
|
+
pub: string[]
|
|
8161
|
+
res1: string[]
|
|
8162
|
+
res2: string[]
|
|
8163
|
+
res3: string[]
|
|
8164
|
+
}
|
|
8165
|
+
```
|
|
8166
|
+
|
|
8167
|
+
**DppGroup** (interface)
|
|
8168
|
+
```typescript
|
|
8169
|
+
interface DppGroup {
|
|
8170
|
+
productGroup: string
|
|
8171
|
+
label: string
|
|
8172
|
+
subGroups: {
|
|
8173
|
+
productSubGroup: string
|
|
8174
|
+
label: string
|
|
8175
|
+
fields: DppViewFields
|
|
8176
|
+
required: DppViewFields
|
|
8177
|
+
}[]
|
|
8178
|
+
}
|
|
8179
|
+
```
|
|
8180
|
+
|
|
8181
|
+
**DppPassportCheck** (interface)
|
|
8182
|
+
```typescript
|
|
8183
|
+
interface DppPassportCheck {
|
|
8184
|
+
ready: boolean
|
|
8185
|
+
missing: Partial<DppViewFields>
|
|
8186
|
+
problem?: string
|
|
8187
|
+
}
|
|
8188
|
+
```
|
|
8189
|
+
|
|
8190
|
+
**DppRegistration** (interface)
|
|
8191
|
+
```typescript
|
|
8192
|
+
interface DppRegistration {
|
|
8193
|
+
status: "processing" | "registered" | "rejected" | "not-sent" | "error"
|
|
8194
|
+
taskId?: string
|
|
8195
|
+
submittedAt?: string
|
|
8196
|
+
correlationId?: string | null
|
|
8197
|
+
registryId?: string | null
|
|
8198
|
+
registeredAt?: string
|
|
8199
|
+
problems?: { code: string; message: string }[] | null
|
|
8200
|
+
checkedAt?: string
|
|
8201
|
+
}
|
|
8202
|
+
```
|
|
8203
|
+
|
|
8204
|
+
**DppPassport** (interface)
|
|
8205
|
+
```typescript
|
|
8206
|
+
interface DppPassport {
|
|
8207
|
+
id: string
|
|
8208
|
+
url: string
|
|
8209
|
+
status: "active" | "withdrawn"
|
|
8210
|
+
productGroup: string
|
|
8211
|
+
productSubGroup: string | null
|
|
8212
|
+
granularity: DppGranularity
|
|
8213
|
+
modelIdentifier: string | null
|
|
8214
|
+
batchIdentifier: string | null
|
|
8215
|
+
productId: string | null
|
|
8216
|
+
batchId: string | null
|
|
8217
|
+
proofId: string | null
|
|
8218
|
+
public: DppFields
|
|
8219
|
+
restricted: DppFields
|
|
8220
|
+
version: number
|
|
8221
|
+
contentUpdatedAt: string | null
|
|
8222
|
+
registration: Partial<Record<DppEnvironment, DppRegistration>>
|
|
8223
|
+
check: DppPassportCheck
|
|
8224
|
+
createdAt: string
|
|
8225
|
+
updatedAt: string
|
|
8226
|
+
}
|
|
8227
|
+
```
|
|
8228
|
+
|
|
8229
|
+
**DppPassportInput** (interface)
|
|
8230
|
+
```typescript
|
|
8231
|
+
interface DppPassportInput {
|
|
8232
|
+
productGroup?: string
|
|
8233
|
+
productSubGroup?: string | null
|
|
8234
|
+
granularity?: DppGranularity
|
|
8235
|
+
modelIdentifier?: string | null
|
|
8236
|
+
batchIdentifier?: string | null
|
|
8237
|
+
productId?: string | null
|
|
8238
|
+
batchId?: string | null
|
|
8239
|
+
proofId?: string | null
|
|
8240
|
+
public?: DppFields | null
|
|
8241
|
+
restricted?: DppFields | null
|
|
8242
|
+
}
|
|
8243
|
+
```
|
|
8244
|
+
|
|
8245
|
+
**DppPassportSaveResult** (interface)
|
|
8246
|
+
```typescript
|
|
8247
|
+
interface DppPassportSaveResult {
|
|
8248
|
+
passport: DppPassport
|
|
8249
|
+
changed: boolean
|
|
8250
|
+
}
|
|
8251
|
+
```
|
|
8252
|
+
|
|
8253
|
+
**DppPassportBulkResult** (interface)
|
|
8254
|
+
```typescript
|
|
8255
|
+
interface DppPassportBulkResult {
|
|
8256
|
+
results: (
|
|
8257
|
+
| { index: number; ok: true; id: string; url: string; created: boolean; changed: boolean; version: number; check: DppPassportCheck }
|
|
8258
|
+
| { index: number; ok: false; errorCode: string; errorText: string }
|
|
8259
|
+
)[]
|
|
8260
|
+
created: number
|
|
8261
|
+
changed: number
|
|
8262
|
+
unchanged: number
|
|
8263
|
+
failed: number
|
|
8264
|
+
}
|
|
8265
|
+
```
|
|
8266
|
+
|
|
8267
|
+
**DppPassportVersion** (interface)
|
|
8268
|
+
```typescript
|
|
8269
|
+
interface DppPassportVersion {
|
|
8270
|
+
version: number
|
|
8271
|
+
savedAt: string
|
|
8272
|
+
savedBy: string | null
|
|
8273
|
+
}
|
|
8274
|
+
```
|
|
8275
|
+
|
|
8276
|
+
**DppPassportListQuery** (interface)
|
|
8277
|
+
```typescript
|
|
8278
|
+
interface DppPassportListQuery {
|
|
8279
|
+
productId?: string
|
|
8280
|
+
batchId?: string
|
|
8281
|
+
proofId?: string
|
|
8282
|
+
status?: "active" | "withdrawn"
|
|
8283
|
+
limit?: number
|
|
8284
|
+
offset?: number
|
|
8285
|
+
}
|
|
8286
|
+
```
|
|
8287
|
+
|
|
8288
|
+
**DppRegisterResult** (interface)
|
|
8289
|
+
```typescript
|
|
8290
|
+
interface DppRegisterResult {
|
|
8291
|
+
tasks: {
|
|
8292
|
+
taskId: string
|
|
8293
|
+
environment: DppEnvironment
|
|
8294
|
+
productGroup: string
|
|
8295
|
+
productSubGroup: string | null
|
|
8296
|
+
passportIds: string[]
|
|
8297
|
+
estimated: string | null
|
|
8298
|
+
status?: string
|
|
8299
|
+
outcome?: DppTaskOutcome | null
|
|
8300
|
+
passports?: ({ id: string } & Partial<DppRegistration>)[]
|
|
8301
|
+
}[]
|
|
8302
|
+
skipped: { id: string; reason: string; missing?: Partial<DppViewFields>; registryId?: string }[]
|
|
8303
|
+
}
|
|
8304
|
+
```
|
|
8305
|
+
|
|
8306
|
+
**DppTaskOutcome** (interface)
|
|
8307
|
+
```typescript
|
|
8308
|
+
interface DppTaskOutcome {
|
|
8309
|
+
outcomeResult: "SUCCEEDED" | "FAILED"
|
|
8310
|
+
outcomeMessage?: { code: string; message: string }
|
|
8311
|
+
}
|
|
8312
|
+
```
|
|
8313
|
+
|
|
8314
|
+
**DppTask** (interface)
|
|
8315
|
+
```typescript
|
|
8316
|
+
interface DppTask {
|
|
8317
|
+
taskId: string
|
|
8318
|
+
environment: DppEnvironment
|
|
8319
|
+
status: string | null
|
|
8320
|
+
outcome: DppTaskOutcome | null
|
|
8321
|
+
passportIds: string[]
|
|
8322
|
+
createdAt: string
|
|
8323
|
+
checkedAt: string | null
|
|
8324
|
+
}
|
|
8325
|
+
```
|
|
8326
|
+
|
|
8327
|
+
**DppTaskRefreshResult** (interface)
|
|
8328
|
+
```typescript
|
|
8329
|
+
interface DppTaskRefreshResult {
|
|
8330
|
+
taskId: string
|
|
8331
|
+
status: string | null
|
|
8332
|
+
outcome: DppTaskOutcome | null
|
|
8333
|
+
processingInfo: { submittedItems: number; compliantItems: number; nonCompliantItems: number } | null
|
|
8334
|
+
passports: ({ id: string } & Partial<DppRegistration>)[]
|
|
8335
|
+
}
|
|
8336
|
+
```
|
|
8337
|
+
|
|
8338
|
+
**DppDocument** (interface)
|
|
8339
|
+
```typescript
|
|
8340
|
+
interface DppDocument {
|
|
8341
|
+
digitalProductPassportId: string
|
|
8342
|
+
uniqueProductIdentifier: string
|
|
8343
|
+
granularity: string
|
|
8344
|
+
dppStatus: string
|
|
8345
|
+
lastUpdate: string
|
|
8346
|
+
contentSpecificationIds: string[]
|
|
8347
|
+
[field: string]: unknown
|
|
8348
|
+
}
|
|
8349
|
+
```
|
|
8350
|
+
|
|
8351
|
+
**DppEnvironment** = `"acc" | "prod" | "local" | (string & {})`
|
|
8352
|
+
|
|
8353
|
+
**DppGranularity** = `"item" | "batch" | "model"`
|
|
8354
|
+
|
|
8355
|
+
**DppRegistryNextStep** = `"make-key" | "enter-service-account" | "enter-organisation-id" | "check" | null`
|
|
8356
|
+
|
|
8357
|
+
**DppFields** = `Record<string, unknown>`
|
|
8358
|
+
|
|
8107
8359
|
### error
|
|
8108
8360
|
|
|
8109
8361
|
**ErrorResponse** (interface)
|
|
@@ -15151,6 +15403,71 @@ Update a crate for a collection (admin only). ```typescript const updated = awai
|
|
|
15151
15403
|
crateId: string) → `Promise<DeleteCrateResponse>`
|
|
15152
15404
|
Delete a crate for a collection (admin only). This performs a soft delete. ```typescript await crate.remove('coll_123', 'crate_abc123') ```
|
|
15153
15405
|
|
|
15406
|
+
### dpp
|
|
15407
|
+
|
|
15408
|
+
**groups**(collectionId: string) → `Promise<DppGroup[]>`
|
|
15409
|
+
What passports can be made: product groups, their kinds, and each view's fields and required fields. GET /dpp/groups
|
|
15410
|
+
|
|
15411
|
+
**read**(collectionId: string, passportId: string, opts: { version?: number } = {}) → `Promise<DppDocument>`
|
|
15412
|
+
Read a passport as the public sees it, at its address (the EU JSON document), or an earlier version of it. No sign-in needed. GET /public/dpp/:collectionId/:passportId
|
|
15413
|
+
|
|
15414
|
+
**register**(collectionId: string, env: DppEnvironment, passportIds: string[], opts: { wait?: boolean } = {}) → `Promise<DppRegisterResult>`
|
|
15415
|
+
Send passports to the EU registry. They're grouped by product group and sent up to 100 at a time; the registry reads each one at its address. Passports still missing required fields, withdrawn or already registered come back in `skipped`. With `wait: true` the call waits (up to ~45 s) and returns each passport's outcome; otherwise follow up with `dpp.tasks.refresh`. POST /dpp/registry/:env/register
|
|
15416
|
+
|
|
15417
|
+
### dpp.passports
|
|
15418
|
+
|
|
15419
|
+
**list**(collectionId: string, q: DppPassportListQuery = {}) → `Promise<DppPassport[]>`
|
|
15420
|
+
GET /dpp/passports
|
|
15421
|
+
|
|
15422
|
+
**get**(collectionId: string, passportId: string) → `Promise<DppPassport>`
|
|
15423
|
+
One passport, with `check` (what it's still missing) and its `url`. GET /dpp/passports/:id
|
|
15424
|
+
|
|
15425
|
+
**create**(collectionId: string, input: DppPassportInput & { productGroup: string }) → `Promise<DppPassport>`
|
|
15426
|
+
Make a passport. POST /dpp/passports
|
|
15427
|
+
|
|
15428
|
+
**update**(collectionId: string, passportId: string, input: DppPassportInput, opts: { replace?: boolean } = {}) → `Promise<DppPassportSaveResult>`
|
|
15429
|
+
Change a passport. `public` / `restricted` are merged into what's there unless `replace` is true. A change to what it says makes a new version. PUT /dpp/passports/:id
|
|
15430
|
+
|
|
15431
|
+
**upsert**(collectionId: string, input: DppPassportUpsertInput, opts: { merge?: boolean } = {}) → `Promise<DppPassportUpsertResult>`
|
|
15432
|
+
Publish the passport for a product, batch or item (`productId` / `batchId` / `proofId`) at a granularity: updates the one already there or makes it. The fields replace what's there (pass `merge: true` to merge). Saving the same content again changes nothing. PUT /dpp/passports/by-anchor ```typescript const { passport } = await dpp.passports.upsert(collectionId, { productId, productGroup: 'BATTERIES', productSubGroup: 'EV', granularity: 'model', public: { batteryChemistry: [...], manufacturerIdentification: {...} }, restricted: { dismantlingInformation: [...] }, }) if (!passport.check.ready) console.log('Still missing', passport.check.missing) ```
|
|
15433
|
+
|
|
15434
|
+
**upsertMany**(collectionId: string, items: DppPassportUpsertInput[], opts: { merge?: boolean } = {}) → `Promise<DppPassportBulkResult>`
|
|
15435
|
+
`upsert` for up to 500 passports at once (e.g. one per battery); each answers on its own. POST /dpp/passports/bulk
|
|
15436
|
+
|
|
15437
|
+
**versions**(collectionId: string, passportId: string) → `Promise<DppPassportVersion[]>`
|
|
15438
|
+
Its versions, newest first; read one with `dpp.read(collectionId, id, { version })`. GET /dpp/passports/:id/versions
|
|
15439
|
+
|
|
15440
|
+
**withdraw**(collectionId: string, passportId: string) → `Promise<DppPassport>`
|
|
15441
|
+
No longer valid: stays at its address, marked invalid (the registry keeps its record). POST /dpp/passports/:id/withdraw
|
|
15442
|
+
|
|
15443
|
+
**restore**(collectionId: string, passportId: string) → `Promise<DppPassport>`
|
|
15444
|
+
Valid again. POST /dpp/passports/:id/restore
|
|
15445
|
+
|
|
15446
|
+
### dpp.registry
|
|
15447
|
+
|
|
15448
|
+
**list**(collectionId: string) → `Promise<DppRegistry[]>`
|
|
15449
|
+
Both environments, each with `nextStep` (what's left to connect). GET /dpp/registry
|
|
15450
|
+
|
|
15451
|
+
**get**(collectionId: string, env: DppEnvironment) → `Promise<DppRegistry>`
|
|
15452
|
+
One environment. GET /dpp/registry/:env
|
|
15453
|
+
|
|
15454
|
+
**makeKey**(collectionId: string, env: DppEnvironment, opts: { alg?: "ES256" | "ES384" | "ES512" } = {}) → `Promise<DppRegistry>`
|
|
15455
|
+
Make (or replace) the key the brand's Service Account trusts. The private key stays on SmartLinks' servers; show `publicPem` (or `publicJwk`) for the brand to add to its Service Account in the registry. Replacing the key clears `kid` — the registry gives the new key its own. POST /dpp/registry/:env/key
|
|
15456
|
+
|
|
15457
|
+
**set**(collectionId: string, env: DppEnvironment, input: SetDppRegistryInput) → `Promise<DppRegistry>`
|
|
15458
|
+
Save the Service Account's Client ID and key ID, and the brand's Organisation ID, from the registry. PUT /dpp/registry/:env
|
|
15459
|
+
|
|
15460
|
+
**check**(collectionId: string, env: DppEnvironment) → `Promise<DppRegistryCheckResult>`
|
|
15461
|
+
Sign in to the registry and read its product groups — proves the connection works. POST /dpp/registry/:env/check
|
|
15462
|
+
|
|
15463
|
+
### dpp.tasks
|
|
15464
|
+
|
|
15465
|
+
**list**(collectionId: string, env: DppEnvironment) → `Promise<DppTask[]>`
|
|
15466
|
+
Requests sent to one environment, newest first. GET /dpp/registry/:env/tasks
|
|
15467
|
+
|
|
15468
|
+
**refresh**(collectionId: string, env: DppEnvironment, taskId: string) → `Promise<DppTaskRefreshResult>`
|
|
15469
|
+
Ask the registry how a request went and record it on its passports. POST /dpp/registry/:env/tasks/:taskId/refresh
|
|
15470
|
+
|
|
15154
15471
|
### errors
|
|
15155
15472
|
|
|
15156
15473
|
**report**(event: ClientErrorReport) → `Promise<`
|