@x12i/helpers 1.0.2 → 1.1.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/dist/access-definition/index.d.ts +3 -0
- package/dist/access-definition/index.d.ts.map +1 -0
- package/dist/access-definition/index.js +19 -0
- package/dist/access-definition/index.js.map +1 -0
- package/dist/access-definition/integration/integrationDefinition.d.ts +2 -0
- package/dist/access-definition/integration/integrationDefinition.d.ts.map +1 -0
- package/dist/access-definition/integration/integrationDefinition.js +3 -0
- package/dist/access-definition/integration/integrationDefinition.js.map +1 -0
- package/dist/access-definition/types.d.ts +43 -0
- package/dist/access-definition/types.d.ts.map +1 -0
- package/dist/access-definition/types.js +3 -0
- package/dist/access-definition/types.js.map +1 -0
- package/package.json +17 -2
- package/src/access-definition/index.ts +3 -0
- package/src/access-definition/integration/integrationDefinition.ts +2 -0
- package/src/access-definition/types.ts +104 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/access-definition/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types.js"), exports);
|
|
18
|
+
__exportStar(require("./integration/integrationDefinition.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/access-definition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yEAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrationDefinition.d.ts","sourceRoot":"","sources":["../../../src/access-definition/integration/integrationDefinition.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrationDefinition.js","sourceRoot":"","sources":["../../../src/access-definition/integration/integrationDefinition.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type AccessLevel = 'public' | 'static-secret' | 'runtime-token' | 'delegated-consent' | 'signed-request' | 'transport-bound' | 'composite';
|
|
2
|
+
export type StorageMode = 'mode-1' | 'mode-2' | 'mode-3';
|
|
3
|
+
export type CredentialKind = 'none' | 'api-key' | 'basic-auth' | 'bearer-token' | 'oauth-access-token' | 'refresh-token' | 'consent-token' | 'session-token' | 'custom-header-secret' | 'hmac-key' | 'jwt-assertion-key' | 'client-certificate';
|
|
4
|
+
export type AcquisitionType = 'preset' | 'client-credentials' | 'authorization-code' | 'refresh-token' | 'token-exchange' | 'login-session' | 'device-code' | 'signed-jwt' | 'manual';
|
|
5
|
+
export type InjectionType = 'header' | 'query' | 'basic-authorization' | 'bearer-authorization' | 'form-body' | 'transport' | 'signature';
|
|
6
|
+
export type PersistenceClass = 'none' | 'ephemeral-memory' | 'local-encrypted' | 'firebase-atm' | 'external-atm';
|
|
7
|
+
export type SecretMaterialClass = 'preset-secret' | 'bootstrap-secret' | 'runtime-token' | 'refresh-material' | 'consent-material' | 'signing-material' | 'transport-identity';
|
|
8
|
+
export type SubjectBinding = 'none' | 'tenant' | 'user' | 'custom';
|
|
9
|
+
export type AccessLeafDefinition = {
|
|
10
|
+
accessLevel: Exclude<AccessLevel, 'composite'>;
|
|
11
|
+
credentialKinds?: CredentialKind[];
|
|
12
|
+
acquisitionType?: AcquisitionType;
|
|
13
|
+
injectionTypes?: InjectionType[];
|
|
14
|
+
persistenceClass?: PersistenceClass;
|
|
15
|
+
refreshSupported?: boolean;
|
|
16
|
+
consentRequired?: boolean;
|
|
17
|
+
signingRequired?: boolean;
|
|
18
|
+
transportRequired?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* References to preset/bootstrap secrets needed to operate this integration.
|
|
21
|
+
* Examples: `secret.hubspot.clientSecret`, `secret.aws.signingKey`.
|
|
22
|
+
*/
|
|
23
|
+
secretRefs?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* References to runtime material produced/consumed by this integration.
|
|
26
|
+
* Examples: `material.hubspot.refresh-token.default`.
|
|
27
|
+
*/
|
|
28
|
+
tokenRefs?: string[];
|
|
29
|
+
};
|
|
30
|
+
export type AccessCompositeDefinition = {
|
|
31
|
+
accessLevel: 'composite';
|
|
32
|
+
layers: AccessDefinition[];
|
|
33
|
+
};
|
|
34
|
+
export type AccessDefinition = AccessLeafDefinition | AccessCompositeDefinition;
|
|
35
|
+
export type IntegrationDefinition = {
|
|
36
|
+
integrationId: string;
|
|
37
|
+
access: AccessDefinition;
|
|
38
|
+
defaults?: {
|
|
39
|
+
subjectBinding?: SubjectBinding;
|
|
40
|
+
storageMode?: StorageMode;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.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B,CAAC;IAEpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,yBAAyB,CAAC;AAEhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE;QACT,cAAc,CAAC,EAAE,cAAc,CAAC;QAChC,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/access-definition/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/helpers",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Small helper utilities for x12i projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "x12i",
|
|
@@ -24,18 +24,33 @@
|
|
|
24
24
|
"./http-tools": "./src/helpers/httpTools.js",
|
|
25
25
|
"./api-mapper": "./src/helpers/apiMapper.js",
|
|
26
26
|
"./api-contracts": "./src/helpers/api-contracts.js",
|
|
27
|
-
"./firebase-rtdb": "./src/helpers/firebaseRtdb.js"
|
|
27
|
+
"./firebase-rtdb": "./src/helpers/firebaseRtdb.js",
|
|
28
|
+
"./access-definition": {
|
|
29
|
+
"types": "./dist/access-definition/index.d.ts",
|
|
30
|
+
"require": "./dist/access-definition/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./access-definition/*": {
|
|
33
|
+
"types": "./dist/access-definition/*.d.ts",
|
|
34
|
+
"require": "./dist/access-definition/*.js"
|
|
35
|
+
}
|
|
28
36
|
},
|
|
29
37
|
"files": [
|
|
30
38
|
"index.js",
|
|
39
|
+
"dist/",
|
|
31
40
|
"src/",
|
|
32
41
|
"README.md",
|
|
33
42
|
"LICENSE"
|
|
34
43
|
],
|
|
35
44
|
"scripts": {
|
|
45
|
+
"build": "npx tsc -p tsconfig.json",
|
|
46
|
+
"prepublishOnly": "npm run build",
|
|
36
47
|
"test": "node --test"
|
|
37
48
|
},
|
|
38
49
|
"dependencies": {
|
|
39
50
|
"firebase-admin": "^13.5.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^24.0.0",
|
|
54
|
+
"typescript": "^5.9.0"
|
|
40
55
|
}
|
|
41
56
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export type AccessLevel =
|
|
2
|
+
| 'public'
|
|
3
|
+
| 'static-secret'
|
|
4
|
+
| 'runtime-token'
|
|
5
|
+
| 'delegated-consent'
|
|
6
|
+
| 'signed-request'
|
|
7
|
+
| 'transport-bound'
|
|
8
|
+
| 'composite';
|
|
9
|
+
|
|
10
|
+
export type StorageMode = 'mode-1' | 'mode-2' | 'mode-3';
|
|
11
|
+
|
|
12
|
+
export type CredentialKind =
|
|
13
|
+
| 'none'
|
|
14
|
+
| 'api-key'
|
|
15
|
+
| 'basic-auth'
|
|
16
|
+
| 'bearer-token'
|
|
17
|
+
| 'oauth-access-token'
|
|
18
|
+
| 'refresh-token'
|
|
19
|
+
| 'consent-token'
|
|
20
|
+
| 'session-token'
|
|
21
|
+
| 'custom-header-secret'
|
|
22
|
+
| 'hmac-key'
|
|
23
|
+
| 'jwt-assertion-key'
|
|
24
|
+
| 'client-certificate';
|
|
25
|
+
|
|
26
|
+
export type AcquisitionType =
|
|
27
|
+
| 'preset'
|
|
28
|
+
| 'client-credentials'
|
|
29
|
+
| 'authorization-code'
|
|
30
|
+
| 'refresh-token'
|
|
31
|
+
| 'token-exchange'
|
|
32
|
+
| 'login-session'
|
|
33
|
+
| 'device-code'
|
|
34
|
+
| 'signed-jwt'
|
|
35
|
+
| 'manual';
|
|
36
|
+
|
|
37
|
+
export type InjectionType =
|
|
38
|
+
| 'header'
|
|
39
|
+
| 'query'
|
|
40
|
+
| 'basic-authorization'
|
|
41
|
+
| 'bearer-authorization'
|
|
42
|
+
| 'form-body'
|
|
43
|
+
| 'transport'
|
|
44
|
+
| 'signature';
|
|
45
|
+
|
|
46
|
+
export type PersistenceClass =
|
|
47
|
+
| 'none'
|
|
48
|
+
| 'ephemeral-memory'
|
|
49
|
+
| 'local-encrypted'
|
|
50
|
+
| 'firebase-atm'
|
|
51
|
+
| 'external-atm';
|
|
52
|
+
|
|
53
|
+
export type SecretMaterialClass =
|
|
54
|
+
| 'preset-secret'
|
|
55
|
+
| 'bootstrap-secret'
|
|
56
|
+
| 'runtime-token'
|
|
57
|
+
| 'refresh-material'
|
|
58
|
+
| 'consent-material'
|
|
59
|
+
| 'signing-material'
|
|
60
|
+
| 'transport-identity';
|
|
61
|
+
|
|
62
|
+
export type SubjectBinding = 'none' | 'tenant' | 'user' | 'custom';
|
|
63
|
+
|
|
64
|
+
export type AccessLeafDefinition = {
|
|
65
|
+
accessLevel: Exclude<AccessLevel, 'composite'>;
|
|
66
|
+
credentialKinds?: CredentialKind[];
|
|
67
|
+
acquisitionType?: AcquisitionType;
|
|
68
|
+
injectionTypes?: InjectionType[];
|
|
69
|
+
persistenceClass?: PersistenceClass;
|
|
70
|
+
|
|
71
|
+
refreshSupported?: boolean;
|
|
72
|
+
consentRequired?: boolean;
|
|
73
|
+
signingRequired?: boolean;
|
|
74
|
+
transportRequired?: boolean;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* References to preset/bootstrap secrets needed to operate this integration.
|
|
78
|
+
* Examples: `secret.hubspot.clientSecret`, `secret.aws.signingKey`.
|
|
79
|
+
*/
|
|
80
|
+
secretRefs?: string[];
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* References to runtime material produced/consumed by this integration.
|
|
84
|
+
* Examples: `material.hubspot.refresh-token.default`.
|
|
85
|
+
*/
|
|
86
|
+
tokenRefs?: string[];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type AccessCompositeDefinition = {
|
|
90
|
+
accessLevel: 'composite';
|
|
91
|
+
layers: AccessDefinition[];
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type AccessDefinition = AccessLeafDefinition | AccessCompositeDefinition;
|
|
95
|
+
|
|
96
|
+
export type IntegrationDefinition = {
|
|
97
|
+
integrationId: string;
|
|
98
|
+
access: AccessDefinition;
|
|
99
|
+
defaults?: {
|
|
100
|
+
subjectBinding?: SubjectBinding;
|
|
101
|
+
storageMode?: StorageMode;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
|