@particle/esim-tooling 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 (77) hide show
  1. package/README.md +187 -0
  2. package/dist/activation-code.d.ts +11 -0
  3. package/dist/activation-code.d.ts.map +1 -0
  4. package/dist/activation-code.js +56 -0
  5. package/dist/activation-code.js.map +1 -0
  6. package/dist/apdu.d.ts +73 -0
  7. package/dist/apdu.d.ts.map +1 -0
  8. package/dist/apdu.js +357 -0
  9. package/dist/apdu.js.map +1 -0
  10. package/dist/errors.d.ts +32 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +52 -0
  13. package/dist/errors.js.map +1 -0
  14. package/dist/es10/es10b-notifications.d.ts +30 -0
  15. package/dist/es10/es10b-notifications.d.ts.map +1 -0
  16. package/dist/es10/es10b-notifications.js +294 -0
  17. package/dist/es10/es10b-notifications.js.map +1 -0
  18. package/dist/es10/es10b.d.ts +34 -0
  19. package/dist/es10/es10b.d.ts.map +1 -0
  20. package/dist/es10/es10b.js +108 -0
  21. package/dist/es10/es10b.js.map +1 -0
  22. package/dist/es10/es10c.d.ts +12 -0
  23. package/dist/es10/es10c.d.ts.map +1 -0
  24. package/dist/es10/es10c.js +133 -0
  25. package/dist/es10/es10c.js.map +1 -0
  26. package/dist/es10/iccid.d.ts +9 -0
  27. package/dist/es10/iccid.d.ts.map +1 -0
  28. package/dist/es10/iccid.js +31 -0
  29. package/dist/es10/iccid.js.map +1 -0
  30. package/dist/es10/index.d.ts +5 -0
  31. package/dist/es10/index.d.ts.map +1 -0
  32. package/dist/es10/index.js +4 -0
  33. package/dist/es10/index.js.map +1 -0
  34. package/dist/es10/tags.d.ts +55 -0
  35. package/dist/es10/tags.d.ts.map +1 -0
  36. package/dist/es10/tags.js +63 -0
  37. package/dist/es10/tags.js.map +1 -0
  38. package/dist/es9plus.d.ts +52 -0
  39. package/dist/es9plus.d.ts.map +1 -0
  40. package/dist/es9plus.js +227 -0
  41. package/dist/es9plus.js.map +1 -0
  42. package/dist/gsma-rsp2-root-ci1.d.ts +38 -0
  43. package/dist/gsma-rsp2-root-ci1.d.ts.map +1 -0
  44. package/dist/gsma-rsp2-root-ci1.js +52 -0
  45. package/dist/gsma-rsp2-root-ci1.js.map +1 -0
  46. package/dist/index.d.ts +6 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +5 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/lpa.d.ts +15 -0
  51. package/dist/lpa.d.ts.map +1 -0
  52. package/dist/lpa.js +283 -0
  53. package/dist/lpa.js.map +1 -0
  54. package/dist/tlv.d.ts +14 -0
  55. package/dist/tlv.d.ts.map +1 -0
  56. package/dist/tlv.js +132 -0
  57. package/dist/tlv.js.map +1 -0
  58. package/dist/types.d.ts +230 -0
  59. package/dist/types.d.ts.map +1 -0
  60. package/dist/types.js +108 -0
  61. package/dist/types.js.map +1 -0
  62. package/package.json +50 -0
  63. package/src/activation-code.ts +64 -0
  64. package/src/apdu.ts +419 -0
  65. package/src/errors.ts +69 -0
  66. package/src/es10/es10b-notifications.ts +331 -0
  67. package/src/es10/es10b.ts +163 -0
  68. package/src/es10/es10c.ts +168 -0
  69. package/src/es10/iccid.ts +32 -0
  70. package/src/es10/index.ts +42 -0
  71. package/src/es10/tags.ts +69 -0
  72. package/src/es9plus.ts +331 -0
  73. package/src/gsma-rsp2-root-ci1.ts +53 -0
  74. package/src/index.ts +43 -0
  75. package/src/lpa.ts +346 -0
  76. package/src/tlv.ts +137 -0
  77. package/src/types.ts +264 -0
package/src/types.ts ADDED
@@ -0,0 +1,264 @@
1
+ export enum ProfileState {
2
+ Disabled = 0,
3
+ Enabled = 1,
4
+ }
5
+
6
+ export enum ProfileClass {
7
+ Test = 0,
8
+ Provisioning = 1,
9
+ Operational = 2,
10
+ }
11
+
12
+ export enum NotificationEvent {
13
+ Install = 0x80,
14
+ Enable = 0x40,
15
+ Disable = 0x20,
16
+ Delete = 0x10,
17
+ }
18
+
19
+ export enum DeleteNotificationStatus {
20
+ Ok = 0,
21
+ NothingToDelete = 1,
22
+ UndefinedError = 127,
23
+ }
24
+
25
+ export enum CancelSessionReason {
26
+ EndUserRejection = 0,
27
+ Postponed = 1,
28
+ Timeout = 2,
29
+ PprNotAllowed = 3,
30
+ MetadataMismatch = 4,
31
+ LoadBppExecutionError = 5,
32
+ SessionAborted = 16,
33
+ EnterpriseProfilesNotSupported = 17,
34
+ EnterpriseRulesNotAllowed = 18,
35
+ EnterpriseProfileNotAllowed = 19,
36
+ EnterpriseOidMismatch = 20,
37
+ EnterpriseRulesError = 21,
38
+ EnterpriseProfilesOnly = 22,
39
+ LprNotSupported = 23,
40
+ LprNetworkDataNotAllowed = 24,
41
+ EmptyProfileOrSpName = 25,
42
+ RpmDisabled = 27,
43
+ InvalidRpmPackage = 28,
44
+ LoadRpmPackageError = 29,
45
+ OperationAbandoned = 30,
46
+ UndefinedReason = 127,
47
+ }
48
+
49
+ export enum EnableProfileResult {
50
+ Ok = 0,
51
+ IccidOrAidNotFound = 1,
52
+ ProfileNotInDisabledState = 2,
53
+ DisallowedByPolicy = 3,
54
+ WrongProfileReenabling = 4,
55
+ CatBusy = 5,
56
+ DisallowedByEnterpriseRule = 6,
57
+ CommandError = 7,
58
+ DisallowedForRpm = 9,
59
+ NoEsimPortAvailable = 10,
60
+ UndefinedError = 127,
61
+ }
62
+
63
+ export enum DisableProfileResult {
64
+ Ok = 0,
65
+ IccidOrAidNotFound = 1,
66
+ ProfileNotInEnabledState = 2,
67
+ DisallowedByPolicy = 3,
68
+ CatBusy = 5,
69
+ DisallowedByEnterpriseRule = 6,
70
+ CommandError = 7,
71
+ DisallowedForRpm = 9,
72
+ UndefinedError = 127,
73
+ }
74
+
75
+ export enum DeleteProfileResult {
76
+ Ok = 0,
77
+ IccidOrAidNotFound = 1,
78
+ ProfileNotInDisabledState = 2,
79
+ DisallowedByPolicy = 3,
80
+ DisallowedInTestMode = 4,
81
+ CommandError = 7,
82
+ UndefinedError = 127,
83
+ }
84
+
85
+ /**
86
+ * Error codes from ProfileInstallationResult errorResult (reasonCode).
87
+ * Per SGP.22 Section 5.7.7.
88
+ */
89
+ export enum BppInstallErrorCode {
90
+ IncorrectInputValues = 1,
91
+ InvalidSignature = 2,
92
+ InvalidTransactionId = 3,
93
+ UnsupportedCrtValues = 4,
94
+ UnsupportedRemoteOperationType = 5,
95
+ UnsupportedProfileClass = 6,
96
+ Scp03tStructureError = 7,
97
+ Scp03tSecurityError = 8,
98
+ IccidAlreadyExistsOnEuicc = 9,
99
+ InsufficientMemoryForProfile = 10,
100
+ InstallInterrupted = 11,
101
+ PeProcessingError = 12,
102
+ DataMismatch = 13,
103
+ TestProfileInvalidNaaKey = 14,
104
+ PprNotAllowed = 15,
105
+ UnknownError = 127,
106
+ }
107
+
108
+ export interface DeviceAdapter {
109
+ sendApdu(apdu: Uint8Array): Promise<Uint8Array>;
110
+ }
111
+
112
+ export interface ServerAdapter {
113
+ sendRsp(smdpAddress: string, endpoint: string, requestData: Uint8Array): Promise<ServerResponse>;
114
+ }
115
+
116
+ export interface ServerResponse {
117
+ statusCode: number;
118
+ responseData?: Uint8Array;
119
+ }
120
+
121
+ export interface Profile {
122
+ iccid: string;
123
+ isdpAid?: string;
124
+ state: ProfileState;
125
+ nickname?: string;
126
+ serviceProviderName?: string;
127
+ profileName?: string;
128
+ profileClass?: ProfileClass;
129
+ }
130
+
131
+ export interface NotificationMetadata {
132
+ seqNumber: number;
133
+ operation: NotificationEvent;
134
+ notificationAddress: string;
135
+ iccid?: string;
136
+ }
137
+
138
+ /**
139
+ * Full notification data from RetrieveNotificationsList.
140
+ * Includes installation result for install notifications.
141
+ */
142
+ export interface Notification extends NotificationMetadata {
143
+ /**
144
+ * For install notifications: whether the installation succeeded.
145
+ * For other notifications (enable/disable/delete): always true (operation completed).
146
+ */
147
+ success: boolean;
148
+ /**
149
+ * Error subject code (only if success=false).
150
+ * See SGP.22 Section 5.7.9 for subject codes.
151
+ */
152
+ errorSubjectCode?: number;
153
+ /**
154
+ * Error reason code (only if success=false).
155
+ * See BppInstallErrorCode enum for common values.
156
+ */
157
+ errorReasonCode?: number;
158
+ }
159
+
160
+ /**
161
+ * Result of BPP loading from the eUICC.
162
+ * Returned after the last STORE DATA command during profile installation.
163
+ */
164
+ export interface ProfileInstallationResult {
165
+ success: boolean;
166
+ /** ICCID of the installed profile (only if success=true) */
167
+ iccid?: string;
168
+ /** Error subject code (only if success=false) */
169
+ errorSubjectCode?: number;
170
+ /** Error reason code (only if success=false) */
171
+ errorReasonCode?: number;
172
+ }
173
+
174
+ /**
175
+ * Result of sending a notification to SM-DP+.
176
+ */
177
+ export interface SendResult {
178
+ /** Whether the notification was successfully sent to SM-DP+ */
179
+ sent: boolean;
180
+ /** Whether the notification was removed from the eUICC (only attempted if sent=true) */
181
+ removed: boolean;
182
+ /** Error message if sending failed */
183
+ error?: string;
184
+ }
185
+
186
+ /**
187
+ * Notification with optional send result.
188
+ */
189
+ export interface NotificationWithResult extends Notification {
190
+ /** Result of sending to SM-DP+. null if send option was false. */
191
+ sendResult: SendResult | null;
192
+ }
193
+
194
+ /**
195
+ * Options for processNotifications.
196
+ */
197
+ export interface ProcessNotificationsOptions {
198
+ /** If true, only list notifications without sending to SM-DP+. Default: false (process and send) */
199
+ listOnly?: boolean;
200
+ /** If true, remove notifications from eUICC even if sending fails. Default: false */
201
+ forceRemove?: boolean;
202
+ }
203
+
204
+ /**
205
+ * Result of processNotifications.
206
+ */
207
+ export interface ProcessNotificationsResult {
208
+ /** All notifications with their details and optional send results */
209
+ notifications: NotificationWithResult[];
210
+ /** Number of notifications successfully sent (only present when send=true) */
211
+ sent?: number;
212
+ /** Number of notifications that failed to send (only present when send=true) */
213
+ failed?: number;
214
+ }
215
+
216
+ export interface ActivationCode {
217
+ format: number;
218
+ smdpAddress: string;
219
+ matchingId: string;
220
+ smdpOid?: string;
221
+ confirmationCodeRequired: boolean;
222
+ }
223
+
224
+ export type DownloadStep =
225
+ | 'parseActivationCode'
226
+ | 'getEuiccChallenge'
227
+ | 'getEuiccInfo'
228
+ | 'initiateAuth'
229
+ | 'authenticateServer'
230
+ | 'authenticateClient'
231
+ | 'prepareDownload'
232
+ | 'getBoundProfilePackage'
233
+ | 'loadProfile'
234
+ | 'complete';
235
+
236
+ export interface DownloadProgress {
237
+ step: DownloadStep;
238
+ detail?: string;
239
+ }
240
+
241
+ export interface DownloadResult {
242
+ success: boolean;
243
+ error?: string;
244
+ /** Error subject code from ProfileInstallationResult (only if success=false) */
245
+ errorSubjectCode?: number;
246
+ /** Error reason code from ProfileInstallationResult (only if success=false) */
247
+ errorReasonCode?: number;
248
+ iccid?: string;
249
+ profileMetadata?: {
250
+ serviceProviderName?: string;
251
+ profileName?: string;
252
+ };
253
+ }
254
+
255
+ export interface InstallProfileOptions {
256
+ activationCode: string;
257
+ confirmationCode?: string;
258
+ onProgress?: (progress: DownloadProgress) => void;
259
+ }
260
+
261
+ export interface EsimLpaOptions {
262
+ device: DeviceAdapter;
263
+ server: ServerAdapter;
264
+ }