@netwo/saas-sdk-v1 1.0.0 → 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/README.md +9 -7
- package/fesm2022/netwo-saas-sdk-v1-openapi.zod-C8EyoRPK.mjs +3806 -0
- package/fesm2022/netwo-saas-sdk-v1-openapi.zod-C8EyoRPK.mjs.map +1 -0
- package/fesm2022/netwo-saas-sdk-v1.mjs +4 -1
- package/fesm2022/netwo-saas-sdk-v1.mjs.map +1 -1
- package/package.json +15 -5
- package/types/netwo-saas-sdk-v1.d.ts +4 -4
|
@@ -30,7 +30,10 @@ const netwoV1Auth = defineInterceptor(({ apiKey, actorSlug, realm }) => headers(
|
|
|
30
30
|
* The requests are authenticated by an API key. `X-Actor-Slug` and `X-Realm` are set by the client
|
|
31
31
|
* (`netwoV1Auth()` interceptor), so they are optional in the requests.
|
|
32
32
|
*/
|
|
33
|
-
const netwoV1Schema = apiSchema('saas-v1'
|
|
33
|
+
const netwoV1Schema = apiSchema('saas-v1', {
|
|
34
|
+
// The responses are validated, the Zod schemas are loaded on demand (first request).
|
|
35
|
+
validators: () => import('./netwo-saas-sdk-v1-openapi.zod-C8EyoRPK.mjs'),
|
|
36
|
+
});
|
|
34
37
|
|
|
35
38
|
/**
|
|
36
39
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"netwo-saas-sdk-v1.mjs","sources":["../../../../../../libs/saas/sdk/v1/src/lib/headers.ts","../../../../../../libs/saas/sdk/v1/src/lib/auth.ts","../../../../../../libs/saas/sdk/v1/src/lib/schema.ts","../../../../../../libs/saas/sdk/v1/src/netwo-saas-sdk-v1.ts"],"sourcesContent":["/** The actor on behalf of whom the request is sent. */\nexport const ACTOR_SLUG_HEADER = 'X-Actor-Slug';\n\n/** The API key authenticating the requests. */\nexport const API_KEY_HEADER = 'X-Api-Key';\n\n/** The targeted environment. */\nexport const REALM_HEADER = 'X-Realm';\n","import { defineInterceptor } from '@netwo/openapi-client';\nimport { HeaderHandler, headers } from '@netwo/openapi-client/interceptors';\nimport { ACTOR_SLUG_HEADER, API_KEY_HEADER, REALM_HEADER } from './headers';\n\nexport interface NetwoV1AuthOptions {\n /** The API key authenticating the requests. */\n readonly apiKey: HeaderHandler;\n /** The actor on behalf of whom the requests are sent. */\n readonly actorSlug?: HeaderHandler;\n /** The targeted environment. */\n readonly realm?: HeaderHandler;\n}\n\n/**\n * Sets the authentication headers of the public API v1, when the request does not set them.\n * The handlers run in the environment context (they can use `inject()` in Angular).\n *\n * ```ts\n * interceptors: [netwoV1Auth({ apiKey: () => env.NETWO_API_KEY, actorSlug: () => env.NETWO_ACTOR_SLUG })]\n * ```\n *\n * `client.without(netwoV1Auth)` removes it.\n */\nexport const netwoV1Auth = defineInterceptor(\n ({ apiKey, actorSlug, realm }: NetwoV1AuthOptions) =>\n headers({\n [API_KEY_HEADER]: apiKey,\n ...(actorSlug && { [ACTOR_SLUG_HEADER]: actorSlug }),\n ...(realm && { [REALM_HEADER]: realm }),\n }).intercept,\n);\n","import { apiSchema } from '@netwo/openapi-client';\nimport type { ACTOR_SLUG_HEADER, REALM_HEADER } from './headers';\nimport type { OpenApi } from './openapi';\n\n/**\n * The public API v1 of Netwo (`https://api.netwo.io/api/v1/...`).\n *\n * The requests are authenticated by an API key. `X-Actor-Slug` and `X-Realm` are set by the client\n * (`netwoV1Auth()` interceptor), so they are optional in the requests.\n */\nexport const netwoV1Schema = apiSchema<\n OpenApi,\n { providedHeaders: typeof REALM_HEADER | typeof ACTOR_SLUG_HEADER }\n>('saas-v1');\n\n/**\n * The type of the schema, to derive the types of the API with the helpers of `@netwo/openapi-client`:\n * `SchemaModels<NetwoV1Schema>['HttpCartDiscount']`, `SchemaResponseBody<NetwoV1Schema, 'get', '/api/v1/cart'>`…\n */\nexport type NetwoV1Schema = typeof netwoV1Schema;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,iBAAiB,GAAG;AAEjC;AACO,MAAM,cAAc,GAAG;AAE9B;AACO,MAAM,YAAY,GAAG;;ACM5B;;;;;;;;;AASG;AACI,MAAM,WAAW,GAAG,iBAAiB,CAC1C,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAsB,KAC/C,OAAO,CAAC;IACN,CAAC,cAAc,GAAG,MAAM;IACxB,IAAI,SAAS,IAAI,EAAE,CAAC,iBAAiB,GAAG,SAAS,EAAE,CAAC;IACpD,IAAI,KAAK,IAAI,EAAE,CAAC,YAAY,GAAG,KAAK,EAAE,CAAC;CACxC,CAAC,CAAC,SAAS;;ACzBhB;;;;;AAKG;
|
|
1
|
+
{"version":3,"file":"netwo-saas-sdk-v1.mjs","sources":["../../../../../../libs/saas/sdk/v1/src/lib/headers.ts","../../../../../../libs/saas/sdk/v1/src/lib/auth.ts","../../../../../../libs/saas/sdk/v1/src/lib/schema.ts","../../../../../../libs/saas/sdk/v1/src/netwo-saas-sdk-v1.ts"],"sourcesContent":["/** The actor on behalf of whom the request is sent. */\nexport const ACTOR_SLUG_HEADER = 'X-Actor-Slug';\n\n/** The API key authenticating the requests. */\nexport const API_KEY_HEADER = 'X-Api-Key';\n\n/** The targeted environment. */\nexport const REALM_HEADER = 'X-Realm';\n","import { defineInterceptor } from '@netwo/openapi-client';\nimport { HeaderHandler, headers } from '@netwo/openapi-client/interceptors';\nimport { ACTOR_SLUG_HEADER, API_KEY_HEADER, REALM_HEADER } from './headers';\n\nexport interface NetwoV1AuthOptions {\n /** The API key authenticating the requests. */\n readonly apiKey: HeaderHandler;\n /** The actor on behalf of whom the requests are sent. */\n readonly actorSlug?: HeaderHandler;\n /** The targeted environment. */\n readonly realm?: HeaderHandler;\n}\n\n/**\n * Sets the authentication headers of the public API v1, when the request does not set them.\n * The handlers run in the environment context (they can use `inject()` in Angular).\n *\n * ```ts\n * interceptors: [netwoV1Auth({ apiKey: () => env.NETWO_API_KEY, actorSlug: () => env.NETWO_ACTOR_SLUG })]\n * ```\n *\n * `client.without(netwoV1Auth)` removes it.\n */\nexport const netwoV1Auth = defineInterceptor(\n ({ apiKey, actorSlug, realm }: NetwoV1AuthOptions) =>\n headers({\n [API_KEY_HEADER]: apiKey,\n ...(actorSlug && { [ACTOR_SLUG_HEADER]: actorSlug }),\n ...(realm && { [REALM_HEADER]: realm }),\n }).intercept,\n);\n","import { apiSchema } from '@netwo/openapi-client';\nimport type { ACTOR_SLUG_HEADER, REALM_HEADER } from './headers';\nimport type { OpenApi } from './openapi';\n\n/**\n * The public API v1 of Netwo (`https://api.netwo.io/api/v1/...`).\n *\n * The requests are authenticated by an API key. `X-Actor-Slug` and `X-Realm` are set by the client\n * (`netwoV1Auth()` interceptor), so they are optional in the requests.\n */\nexport const netwoV1Schema = apiSchema<\n OpenApi,\n { providedHeaders: typeof REALM_HEADER | typeof ACTOR_SLUG_HEADER }\n>('saas-v1', {\n // The responses are validated, the Zod schemas are loaded on demand (first request).\n validators: () => import('./openapi.zod'),\n});\n\n/**\n * The type of the schema, to derive the types of the API with the helpers of `@netwo/openapi-client`:\n * `SchemaModels<NetwoV1Schema>['HttpCartDiscount']`, `SchemaResponseBody<NetwoV1Schema, 'get', '/api/v1/cart'>`…\n */\nexport type NetwoV1Schema = typeof netwoV1Schema;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,iBAAiB,GAAG;AAEjC;AACO,MAAM,cAAc,GAAG;AAE9B;AACO,MAAM,YAAY,GAAG;;ACM5B;;;;;;;;;AASG;AACI,MAAM,WAAW,GAAG,iBAAiB,CAC1C,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAsB,KAC/C,OAAO,CAAC;IACN,CAAC,cAAc,GAAG,MAAM;IACxB,IAAI,SAAS,IAAI,EAAE,CAAC,iBAAiB,GAAG,SAAS,EAAE,CAAC;IACpD,IAAI,KAAK,IAAI,EAAE,CAAC,YAAY,GAAG,KAAK,EAAE,CAAC;CACxC,CAAC,CAAC,SAAS;;ACzBhB;;;;;AAKG;AACI,MAAM,aAAa,GAAG,SAAS,CAGpC,SAAS,EAAE;;AAEX,IAAA,UAAU,EAAE,MAAM,OAAO,8CAAe,CAAC;AAC1C,CAAA;;AChBD;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netwo/saas-sdk-v1",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Typed schema and authentication of the Netwo public API v1, for @netwo/openapi-client.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"netwo",
|
|
7
|
+
"sdk",
|
|
8
|
+
"api-client",
|
|
9
|
+
"openapi",
|
|
10
|
+
"typescript",
|
|
11
|
+
"angular",
|
|
12
|
+
"rxjs"
|
|
13
|
+
],
|
|
5
14
|
"license": "MIT",
|
|
6
15
|
"homepage": "https://www.netwo.io",
|
|
7
16
|
"sideEffects": false,
|
|
8
17
|
"publishConfig": {
|
|
9
18
|
"access": "public"
|
|
10
19
|
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"zod": "^4.0.0",
|
|
22
|
+
"tslib": "^2.3.0"
|
|
23
|
+
},
|
|
11
24
|
"peerDependencies": {
|
|
12
25
|
"@netwo/openapi-client": "^1.0.0"
|
|
13
26
|
},
|
|
@@ -22,8 +35,5 @@
|
|
|
22
35
|
"default": "./fesm2022/netwo-saas-sdk-v1.mjs"
|
|
23
36
|
}
|
|
24
37
|
},
|
|
25
|
-
"type": "module"
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"tslib": "^2.3.0"
|
|
28
|
-
}
|
|
38
|
+
"type": "module"
|
|
29
39
|
}
|
|
@@ -4254,11 +4254,11 @@ interface components {
|
|
|
4254
4254
|
};
|
|
4255
4255
|
EmergencyAddressUpdatePayload: {
|
|
4256
4256
|
addition_to_address?: string | null;
|
|
4257
|
-
city
|
|
4258
|
-
insee_code
|
|
4259
|
-
street
|
|
4257
|
+
city: string;
|
|
4258
|
+
insee_code: string;
|
|
4259
|
+
street: string;
|
|
4260
4260
|
street_number?: string | null;
|
|
4261
|
-
zip_code
|
|
4261
|
+
zip_code: string;
|
|
4262
4262
|
};
|
|
4263
4263
|
EndCustomerRequest: {
|
|
4264
4264
|
/** Format: uuid */
|