@katerai/sdk 0.6.0 → 0.8.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/CHANGELOG.md +34 -0
- package/README.md +23 -16
- package/client.d.mts +10 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -13
- package/client.d.ts.map +1 -1
- package/client.js +37 -15
- package/client.js.map +1 -1
- package/client.mjs +37 -15
- package/client.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -1
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/index.d.mts +0 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +0 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -2
- package/resources/index.mjs.map +1 -1
- package/resources/v1/compiler.d.mts +1116 -0
- package/resources/v1/compiler.d.mts.map +1 -0
- package/resources/v1/compiler.d.ts +1116 -0
- package/resources/v1/compiler.d.ts.map +1 -0
- package/resources/v1/compiler.js +70 -0
- package/resources/v1/compiler.js.map +1 -0
- package/resources/v1/compiler.mjs +66 -0
- package/resources/v1/compiler.mjs.map +1 -0
- package/resources/v1/connections.d.mts +216 -1
- package/resources/v1/connections.d.mts.map +1 -1
- package/resources/v1/connections.d.ts +216 -1
- package/resources/v1/connections.d.ts.map +1 -1
- package/resources/v1/connections.js +22 -2
- package/resources/v1/connections.js.map +1 -1
- package/resources/v1/connections.mjs +20 -1
- package/resources/v1/connections.mjs.map +1 -1
- package/resources/v1/index.d.mts +3 -6
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -6
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +7 -13
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +2 -5
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/tenants/groups.d.mts +5 -5
- package/resources/v1/tenants/groups.d.mts.map +1 -1
- package/resources/v1/tenants/groups.d.ts +5 -5
- package/resources/v1/tenants/groups.d.ts.map +1 -1
- package/resources/v1/tenants/groups.js +1 -1
- package/resources/v1/tenants/groups.js.map +1 -1
- package/resources/v1/tenants/groups.mjs +1 -1
- package/resources/v1/tenants/groups.mjs.map +1 -1
- package/resources/v1/tenants/index.d.mts +2 -4
- package/resources/v1/tenants/index.d.mts.map +1 -1
- package/resources/v1/tenants/index.d.ts +2 -4
- package/resources/v1/tenants/index.d.ts.map +1 -1
- package/resources/v1/tenants/index.js +1 -5
- package/resources/v1/tenants/index.js.map +1 -1
- package/resources/v1/tenants/index.mjs +0 -2
- package/resources/v1/tenants/index.mjs.map +1 -1
- package/resources/v1/tenants/tenants.d.mts +72 -151
- package/resources/v1/tenants/tenants.d.mts.map +1 -1
- package/resources/v1/tenants/tenants.d.ts +72 -151
- package/resources/v1/tenants/tenants.d.ts.map +1 -1
- package/resources/v1/tenants/tenants.js +29 -72
- package/resources/v1/tenants/tenants.js.map +1 -1
- package/resources/v1/tenants/tenants.mjs +29 -72
- package/resources/v1/tenants/tenants.mjs.map +1 -1
- package/resources/v1/v1.d.mts +9 -21
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +9 -21
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +6 -18
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +6 -18
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +48 -23
- package/src/internal/utils/log.ts +1 -0
- package/src/resources/index.ts +0 -2
- package/src/resources/v1/compiler.ts +1484 -0
- package/src/resources/v1/connections.ts +277 -1
- package/src/resources/v1/index.ts +23 -43
- package/src/resources/v1/tenants/groups.ts +5 -5
- package/src/resources/v1/tenants/index.ts +5 -24
- package/src/resources/v1/tenants/tenants.ts +89 -213
- package/src/resources/v1/v1.ts +49 -101
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/healthz.d.mts +0 -16
- package/resources/healthz.d.mts.map +0 -1
- package/resources/healthz.d.ts +0 -16
- package/resources/healthz.d.ts.map +0 -1
- package/resources/healthz.js +0 -15
- package/resources/healthz.js.map +0 -1
- package/resources/healthz.mjs +0 -11
- package/resources/healthz.mjs.map +0 -1
- package/resources/readyz.d.mts +0 -16
- package/resources/readyz.d.mts.map +0 -1
- package/resources/readyz.d.ts +0 -16
- package/resources/readyz.d.ts.map +0 -1
- package/resources/readyz.js +0 -15
- package/resources/readyz.js.map +0 -1
- package/resources/readyz.mjs +0 -11
- package/resources/readyz.mjs.map +0 -1
- package/resources/v1/connections/connections.d.mts +0 -1470
- package/resources/v1/connections/connections.d.mts.map +0 -1
- package/resources/v1/connections/connections.d.ts +0 -1470
- package/resources/v1/connections/connections.d.ts.map +0 -1
- package/resources/v1/connections/connections.js +0 -163
- package/resources/v1/connections/connections.js.map +0 -1
- package/resources/v1/connections/connections.mjs +0 -158
- package/resources/v1/connections/connections.mjs.map +0 -1
- package/resources/v1/connections/databases.d.mts +0 -25
- package/resources/v1/connections/databases.d.mts.map +0 -1
- package/resources/v1/connections/databases.d.ts +0 -25
- package/resources/v1/connections/databases.d.ts.map +0 -1
- package/resources/v1/connections/databases.js +0 -26
- package/resources/v1/connections/databases.js.map +0 -1
- package/resources/v1/connections/databases.mjs +0 -22
- package/resources/v1/connections/databases.mjs.map +0 -1
- package/resources/v1/connections/index.d.mts +0 -5
- package/resources/v1/connections/index.d.mts.map +0 -1
- package/resources/v1/connections/index.d.ts +0 -5
- package/resources/v1/connections/index.d.ts.map +0 -1
- package/resources/v1/connections/index.js +0 -13
- package/resources/v1/connections/index.js.map +0 -1
- package/resources/v1/connections/index.mjs +0 -6
- package/resources/v1/connections/index.mjs.map +0 -1
- package/resources/v1/connections/views.d.mts +0 -77
- package/resources/v1/connections/views.d.mts.map +0 -1
- package/resources/v1/connections/views.d.ts +0 -77
- package/resources/v1/connections/views.d.ts.map +0 -1
- package/resources/v1/connections/views.js +0 -24
- package/resources/v1/connections/views.js.map +0 -1
- package/resources/v1/connections/views.mjs +0 -20
- package/resources/v1/connections/views.mjs.map +0 -1
- package/resources/v1/connections/yaml.d.mts +0 -57
- package/resources/v1/connections/yaml.d.mts.map +0 -1
- package/resources/v1/connections/yaml.d.ts +0 -57
- package/resources/v1/connections/yaml.d.ts.map +0 -1
- package/resources/v1/connections/yaml.js +0 -22
- package/resources/v1/connections/yaml.js.map +0 -1
- package/resources/v1/connections/yaml.mjs +0 -18
- package/resources/v1/connections/yaml.mjs.map +0 -1
- package/resources/v1/github/github.d.mts +0 -99
- package/resources/v1/github/github.d.mts.map +0 -1
- package/resources/v1/github/github.d.ts +0 -99
- package/resources/v1/github/github.d.ts.map +0 -1
- package/resources/v1/github/github.js +0 -49
- package/resources/v1/github/github.js.map +0 -1
- package/resources/v1/github/github.mjs +0 -44
- package/resources/v1/github/github.mjs.map +0 -1
- package/resources/v1/github/index.d.mts +0 -5
- package/resources/v1/github/index.d.mts.map +0 -1
- package/resources/v1/github/index.d.ts +0 -5
- package/resources/v1/github/index.d.ts.map +0 -1
- package/resources/v1/github/index.js +0 -13
- package/resources/v1/github/index.js.map +0 -1
- package/resources/v1/github/index.mjs +0 -6
- package/resources/v1/github/index.mjs.map +0 -1
- package/resources/v1/github/repos.d.mts +0 -54
- package/resources/v1/github/repos.d.mts.map +0 -1
- package/resources/v1/github/repos.d.ts +0 -54
- package/resources/v1/github/repos.d.ts.map +0 -1
- package/resources/v1/github/repos.js +0 -22
- package/resources/v1/github/repos.js.map +0 -1
- package/resources/v1/github/repos.mjs +0 -18
- package/resources/v1/github/repos.mjs.map +0 -1
- package/resources/v1/github/scaffold.d.mts +0 -29
- package/resources/v1/github/scaffold.d.mts.map +0 -1
- package/resources/v1/github/scaffold.d.ts +0 -29
- package/resources/v1/github/scaffold.d.ts.map +0 -1
- package/resources/v1/github/scaffold.js +0 -21
- package/resources/v1/github/scaffold.js.map +0 -1
- package/resources/v1/github/scaffold.mjs +0 -17
- package/resources/v1/github/scaffold.mjs.map +0 -1
- package/resources/v1/github/webhooks.d.mts +0 -28
- package/resources/v1/github/webhooks.d.mts.map +0 -1
- package/resources/v1/github/webhooks.d.ts +0 -28
- package/resources/v1/github/webhooks.d.ts.map +0 -1
- package/resources/v1/github/webhooks.js +0 -27
- package/resources/v1/github/webhooks.js.map +0 -1
- package/resources/v1/github/webhooks.mjs +0 -23
- package/resources/v1/github/webhooks.mjs.map +0 -1
- package/resources/v1/github.d.mts +0 -2
- package/resources/v1/github.d.mts.map +0 -1
- package/resources/v1/github.d.ts +0 -2
- package/resources/v1/github.d.ts.map +0 -1
- package/resources/v1/github.js +0 -6
- package/resources/v1/github.js.map +0 -1
- package/resources/v1/github.mjs +0 -3
- package/resources/v1/github.mjs.map +0 -1
- package/resources/v1/groups/groups.d.mts +0 -162
- package/resources/v1/groups/groups.d.mts.map +0 -1
- package/resources/v1/groups/groups.d.ts +0 -162
- package/resources/v1/groups/groups.d.ts.map +0 -1
- package/resources/v1/groups/groups.js +0 -81
- package/resources/v1/groups/groups.js.map +0 -1
- package/resources/v1/groups/groups.mjs +0 -76
- package/resources/v1/groups/groups.mjs.map +0 -1
- package/resources/v1/groups/index.d.mts +0 -3
- package/resources/v1/groups/index.d.mts.map +0 -1
- package/resources/v1/groups/index.d.ts +0 -3
- package/resources/v1/groups/index.d.ts.map +0 -1
- package/resources/v1/groups/index.js +0 -9
- package/resources/v1/groups/index.js.map +0 -1
- package/resources/v1/groups/index.mjs +0 -4
- package/resources/v1/groups/index.mjs.map +0 -1
- package/resources/v1/groups/tenants.d.mts +0 -55
- package/resources/v1/groups/tenants.d.mts.map +0 -1
- package/resources/v1/groups/tenants.d.ts +0 -55
- package/resources/v1/groups/tenants.d.ts.map +0 -1
- package/resources/v1/groups/tenants.js +0 -39
- package/resources/v1/groups/tenants.js.map +0 -1
- package/resources/v1/groups/tenants.mjs +0 -35
- package/resources/v1/groups/tenants.mjs.map +0 -1
- package/resources/v1/groups.d.mts +0 -2
- package/resources/v1/groups.d.mts.map +0 -1
- package/resources/v1/groups.d.ts +0 -2
- package/resources/v1/groups.d.ts.map +0 -1
- package/resources/v1/groups.js +0 -6
- package/resources/v1/groups.js.map +0 -1
- package/resources/v1/groups.mjs +0 -3
- package/resources/v1/groups.mjs.map +0 -1
- package/resources/v1/me.d.mts +0 -43
- package/resources/v1/me.d.mts.map +0 -1
- package/resources/v1/me.d.ts +0 -43
- package/resources/v1/me.d.ts.map +0 -1
- package/resources/v1/me.js +0 -20
- package/resources/v1/me.js.map +0 -1
- package/resources/v1/me.mjs +0 -16
- package/resources/v1/me.mjs.map +0 -1
- package/resources/v1/org/client.d.mts +0 -53
- package/resources/v1/org/client.d.mts.map +0 -1
- package/resources/v1/org/client.d.ts +0 -53
- package/resources/v1/org/client.d.ts.map +0 -1
- package/resources/v1/org/client.js +0 -25
- package/resources/v1/org/client.js.map +0 -1
- package/resources/v1/org/client.mjs +0 -21
- package/resources/v1/org/client.mjs.map +0 -1
- package/resources/v1/org/index.d.mts +0 -4
- package/resources/v1/org/index.d.mts.map +0 -1
- package/resources/v1/org/index.d.ts +0 -4
- package/resources/v1/org/index.d.ts.map +0 -1
- package/resources/v1/org/index.js +0 -11
- package/resources/v1/org/index.js.map +0 -1
- package/resources/v1/org/index.mjs +0 -5
- package/resources/v1/org/index.mjs.map +0 -1
- package/resources/v1/org/org.d.mts +0 -14
- package/resources/v1/org/org.d.mts.map +0 -1
- package/resources/v1/org/org.d.ts +0 -14
- package/resources/v1/org/org.d.ts.map +0 -1
- package/resources/v1/org/org.js +0 -21
- package/resources/v1/org/org.js.map +0 -1
- package/resources/v1/org/org.mjs +0 -16
- package/resources/v1/org/org.mjs.map +0 -1
- package/resources/v1/org/users.d.mts +0 -87
- package/resources/v1/org/users.d.mts.map +0 -1
- package/resources/v1/org/users.d.ts +0 -87
- package/resources/v1/org/users.d.ts.map +0 -1
- package/resources/v1/org/users.js +0 -60
- package/resources/v1/org/users.js.map +0 -1
- package/resources/v1/org/users.mjs +0 -56
- package/resources/v1/org/users.mjs.map +0 -1
- package/resources/v1/org.d.mts +0 -2
- package/resources/v1/org.d.mts.map +0 -1
- package/resources/v1/org.d.ts +0 -2
- package/resources/v1/org.d.ts.map +0 -1
- package/resources/v1/org.js +0 -6
- package/resources/v1/org.js.map +0 -1
- package/resources/v1/org.mjs +0 -3
- package/resources/v1/org.mjs.map +0 -1
- package/resources/v1/tenants/batch.d.mts +0 -159
- package/resources/v1/tenants/batch.d.mts.map +0 -1
- package/resources/v1/tenants/batch.d.ts +0 -159
- package/resources/v1/tenants/batch.d.ts.map +0 -1
- package/resources/v1/tenants/batch.js +0 -42
- package/resources/v1/tenants/batch.js.map +0 -1
- package/resources/v1/tenants/batch.mjs +0 -38
- package/resources/v1/tenants/batch.mjs.map +0 -1
- package/resources/v1/tenants/import.d.mts +0 -126
- package/resources/v1/tenants/import.d.mts.map +0 -1
- package/resources/v1/tenants/import.d.ts +0 -126
- package/resources/v1/tenants/import.d.ts.map +0 -1
- package/resources/v1/tenants/import.js +0 -50
- package/resources/v1/tenants/import.js.map +0 -1
- package/resources/v1/tenants/import.mjs +0 -46
- package/resources/v1/tenants/import.mjs.map +0 -1
- package/src/resources/healthz.ts +0 -20
- package/src/resources/readyz.ts +0 -20
- package/src/resources/v1/connections/connections.ts +0 -1905
- package/src/resources/v1/connections/databases.ts +0 -42
- package/src/resources/v1/connections/index.ts +0 -33
- package/src/resources/v1/connections/views.ts +0 -112
- package/src/resources/v1/connections/yaml.ts +0 -81
- package/src/resources/v1/github/github.ts +0 -165
- package/src/resources/v1/github/index.ts +0 -20
- package/src/resources/v1/github/repos.ts +0 -85
- package/src/resources/v1/github/scaffold.ts +0 -44
- package/src/resources/v1/github/webhooks.ts +0 -60
- package/src/resources/v1/github.ts +0 -3
- package/src/resources/v1/groups/groups.ts +0 -218
- package/src/resources/v1/groups/index.ts +0 -10
- package/src/resources/v1/groups/tenants.ts +0 -78
- package/src/resources/v1/groups.ts +0 -3
- package/src/resources/v1/me.ts +0 -62
- package/src/resources/v1/org/client.ts +0 -81
- package/src/resources/v1/org/index.ts +0 -11
- package/src/resources/v1/org/org.ts +0 -32
- package/src/resources/v1/org/users.ts +0 -127
- package/src/resources/v1/org.ts +0 -3
- package/src/resources/v1/tenants/batch.ts +0 -200
- package/src/resources/v1/tenants/import.ts +0 -158
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"tenants.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,kCAAkC,EAAE,MAAM,EAAE;OAC9C,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;;;;;;OAQG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;IAItF;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAOpC;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CACjB,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;CAGrC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE5C;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;KACpB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACvD;AAED,yBAAiB,8BAA8B,CAAC;IAC9C,UAAiB,MAAM;QACrB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAE9B;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB;CACF;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAID,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,KAAK,kCAAkC,IAAI,kCAAkC,EAAE,CAAC;CAC5G"}
|
|
@@ -1,185 +1,112 @@
|
|
|
1
1
|
import { APIResource } from "../../../core/resource.js";
|
|
2
|
-
import * as BatchAPI from "./batch.js";
|
|
3
|
-
import { Batch, BatchCreateParams, BatchCreateResponse, BatchDeleteParams, BatchDeleteResponse, BatchTenantError, BatchTenantSuccess, BatchUpdateParams, BatchUpdateResponse } from "./batch.js";
|
|
4
2
|
import * as GroupsAPI from "./groups.js";
|
|
5
|
-
import {
|
|
6
|
-
import * as ImportAPI from "./import.js";
|
|
7
|
-
import { Import, ImportFromCsvParams, ImportFromWarehouseParams, ImportTenants } from "./import.js";
|
|
3
|
+
import { GroupGetTenantGroupsSchemaResponse, Groups } from "./groups.js";
|
|
8
4
|
import { APIPromise } from "../../../core/api-promise.js";
|
|
5
|
+
import { type Uploadable } from "../../../core/uploads.js";
|
|
9
6
|
import { RequestOptions } from "../../../internal/request-options.js";
|
|
10
7
|
export declare class Tenants extends APIResource {
|
|
11
|
-
batch: BatchAPI.Batch;
|
|
12
|
-
import: ImportAPI.Import;
|
|
13
8
|
groups: GroupsAPI.Groups;
|
|
14
9
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* Validates the client's tenancy type and creates the tenant accordingly:
|
|
18
|
-
*
|
|
19
|
-
* - ROW tenancy: Creates tenant with optional group associations
|
|
20
|
-
* - DATABASE tenancy: Requires database_name, creates tenant with database
|
|
21
|
-
* association
|
|
22
|
-
* - NONE tenancy: Returns error (tenant creation not allowed)
|
|
23
|
-
*
|
|
24
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
25
|
-
*/
|
|
26
|
-
create(body: TenantCreateParams, options?: RequestOptions): APIPromise<Tenant>;
|
|
27
|
-
/**
|
|
28
|
-
* Get a single tenant by ID.
|
|
10
|
+
* Get all tenants as a TenantSchema object.
|
|
29
11
|
*
|
|
30
|
-
* Returns the
|
|
12
|
+
* Returns tenants in the YAML-compatible schema format with group references.
|
|
13
|
+
* Supports content negotiation: JSON by default, YAML with Accept:
|
|
14
|
+
* application/yaml.
|
|
31
15
|
*
|
|
32
16
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
33
|
-
*
|
|
34
|
-
* Raises: TenantNotFoundError: If tenant doesn't exist (404)
|
|
35
17
|
*/
|
|
36
|
-
|
|
18
|
+
getTenantsSchema(options?: RequestOptions): APIPromise<TenantGetTenantsSchemaResponse>;
|
|
37
19
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* Updates tenant metadata, group associations, and/or database associations. Group
|
|
41
|
-
* associations use replace semantics:
|
|
20
|
+
* Import tenants from a CSV file using upsert semantics.
|
|
42
21
|
*
|
|
43
|
-
*
|
|
44
|
-
* - Pass empty list to remove all group associations
|
|
45
|
-
* - Pass list of names to replace all associations
|
|
22
|
+
* Expected CSV format:
|
|
46
23
|
*
|
|
47
|
-
*
|
|
24
|
+
* - tenant_key (required): Unique tenant identifier
|
|
25
|
+
* - tenant_name (optional): Human-readable name
|
|
26
|
+
* - group_names (optional): Comma-separated list of group names
|
|
48
27
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
28
|
+
* Creates new tenants and updates existing ones with new name/groups. Groups are
|
|
29
|
+
* added additively (not replaced) and auto-created if needed.
|
|
51
30
|
*
|
|
52
31
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
53
32
|
*
|
|
54
|
-
* Raises:
|
|
33
|
+
* Raises: ValidationError: If CSV format is invalid (400)
|
|
34
|
+
* TenantCreationNotAllowedError: If tenancy type is NONE (400)
|
|
55
35
|
*/
|
|
56
|
-
|
|
36
|
+
importFromCsv(body: TenantImportFromCsvParams, options?: RequestOptions): APIPromise<ImportTenantsResponse>;
|
|
57
37
|
/**
|
|
58
|
-
*
|
|
38
|
+
* Import tenants from a warehouse table using upsert semantics.
|
|
59
39
|
*
|
|
60
|
-
*
|
|
40
|
+
* Creates new tenants and updates existing ones with new name/groups. Groups are
|
|
41
|
+
* added additively (not replaced).
|
|
61
42
|
*
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
list(options?: RequestOptions): APIPromise<TenantListResponse>;
|
|
65
|
-
/**
|
|
66
|
-
* Delete a tenant.
|
|
43
|
+
* Streams data from the warehouse in batches to handle large datasets without
|
|
44
|
+
* loading everything into memory.
|
|
67
45
|
*
|
|
68
|
-
*
|
|
46
|
+
* For tenants with groups, groups are aggregated per tenant key and auto-created
|
|
47
|
+
* if they don't exist.
|
|
69
48
|
*
|
|
70
49
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
71
50
|
*
|
|
72
|
-
* Raises:
|
|
51
|
+
* Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
|
|
52
|
+
* TenantCreationNotAllowedError: If tenancy type is NONE (400)
|
|
73
53
|
*/
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Get all tenants as a TenantSchema object.
|
|
77
|
-
*
|
|
78
|
-
* Returns tenants in the YAML-compatible schema format with group references.
|
|
79
|
-
* Supports content negotiation: JSON by default, YAML with Accept:
|
|
80
|
-
* application/yaml.
|
|
81
|
-
*
|
|
82
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
83
|
-
*/
|
|
84
|
-
retrieveSchema(options?: RequestOptions): APIPromise<TenantRetrieveSchemaResponse>;
|
|
54
|
+
importFromWarehouse(body: TenantImportFromWarehouseParams, options?: RequestOptions): APIPromise<ImportTenantsResponse>;
|
|
85
55
|
}
|
|
86
56
|
/**
|
|
87
|
-
*
|
|
57
|
+
* Response model for tenant import operation.
|
|
88
58
|
*/
|
|
89
|
-
export interface
|
|
59
|
+
export interface ImportTenantsResponse {
|
|
90
60
|
/**
|
|
91
|
-
* Unique tenant
|
|
61
|
+
* Unique tenant keys found in source
|
|
92
62
|
*/
|
|
93
|
-
|
|
63
|
+
total_found: number;
|
|
94
64
|
/**
|
|
95
|
-
*
|
|
65
|
+
* New tenants created
|
|
96
66
|
*/
|
|
97
|
-
|
|
67
|
+
total_imported: number;
|
|
98
68
|
/**
|
|
99
|
-
*
|
|
69
|
+
* Existing tenants updated
|
|
100
70
|
*/
|
|
101
|
-
|
|
71
|
+
total_updated: number;
|
|
102
72
|
/**
|
|
103
|
-
*
|
|
73
|
+
* Tenant-specific errors
|
|
104
74
|
*/
|
|
105
|
-
|
|
75
|
+
errors?: Array<ImportTenantsResponse.Error>;
|
|
106
76
|
/**
|
|
107
|
-
*
|
|
77
|
+
* Groups that were auto-created
|
|
108
78
|
*/
|
|
109
|
-
|
|
79
|
+
groups_created?: Array<string>;
|
|
110
80
|
}
|
|
111
|
-
|
|
112
|
-
* Response model for a single tenant.
|
|
113
|
-
*/
|
|
114
|
-
export interface Tenant {
|
|
81
|
+
export declare namespace ImportTenantsResponse {
|
|
115
82
|
/**
|
|
116
|
-
*
|
|
83
|
+
* Error for a single tenant during import.
|
|
117
84
|
*/
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Creation timestamp
|
|
121
|
-
*/
|
|
122
|
-
created_at: string;
|
|
123
|
-
/**
|
|
124
|
-
* Associated databases
|
|
125
|
-
*/
|
|
126
|
-
databases: Array<Tenant.Database>;
|
|
127
|
-
/**
|
|
128
|
-
* Associated groups
|
|
129
|
-
*/
|
|
130
|
-
groups: Array<Tenant.Group>;
|
|
131
|
-
/**
|
|
132
|
-
* Human-readable tenant name
|
|
133
|
-
*/
|
|
134
|
-
name: string | null;
|
|
135
|
-
/**
|
|
136
|
-
* Unique tenant identifier
|
|
137
|
-
*/
|
|
138
|
-
tenant_key: string;
|
|
139
|
-
/**
|
|
140
|
-
* Last update timestamp
|
|
141
|
-
*/
|
|
142
|
-
updated_at: string;
|
|
143
|
-
}
|
|
144
|
-
export declare namespace Tenant {
|
|
145
|
-
/**
|
|
146
|
-
* Database information in tenant responses.
|
|
147
|
-
*/
|
|
148
|
-
interface Database {
|
|
149
|
-
/**
|
|
150
|
-
* Database ID
|
|
151
|
-
*/
|
|
152
|
-
id: string;
|
|
85
|
+
interface Error {
|
|
153
86
|
/**
|
|
154
|
-
*
|
|
87
|
+
* Error code
|
|
155
88
|
*/
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Group information in tenant responses.
|
|
160
|
-
*/
|
|
161
|
-
interface Group {
|
|
89
|
+
code: string;
|
|
162
90
|
/**
|
|
163
|
-
*
|
|
91
|
+
* Error message
|
|
164
92
|
*/
|
|
165
|
-
|
|
93
|
+
message: string;
|
|
166
94
|
/**
|
|
167
|
-
*
|
|
95
|
+
* Tenant key that failed
|
|
168
96
|
*/
|
|
169
|
-
|
|
97
|
+
tenant_key: string;
|
|
170
98
|
}
|
|
171
99
|
}
|
|
172
|
-
export type TenantListResponse = Array<Tenant>;
|
|
173
100
|
/**
|
|
174
101
|
* Schema for tenant configuration files
|
|
175
102
|
*/
|
|
176
|
-
export interface
|
|
103
|
+
export interface TenantGetTenantsSchemaResponse {
|
|
177
104
|
/**
|
|
178
105
|
* Array of tenant configurations
|
|
179
106
|
*/
|
|
180
|
-
tenants: Array<
|
|
107
|
+
tenants: Array<TenantGetTenantsSchemaResponse.Tenant>;
|
|
181
108
|
}
|
|
182
|
-
export declare namespace
|
|
109
|
+
export declare namespace TenantGetTenantsSchemaResponse {
|
|
183
110
|
interface Tenant {
|
|
184
111
|
/**
|
|
185
112
|
* Unique Kater identifier
|
|
@@ -199,50 +126,44 @@ export declare namespace TenantRetrieveSchemaResponse {
|
|
|
199
126
|
name?: string | null;
|
|
200
127
|
}
|
|
201
128
|
}
|
|
202
|
-
export interface
|
|
203
|
-
/**
|
|
204
|
-
* Unique tenant identifier within the client
|
|
205
|
-
*/
|
|
206
|
-
tenant_key: string;
|
|
129
|
+
export interface TenantImportFromCsvParams {
|
|
207
130
|
/**
|
|
208
|
-
*
|
|
131
|
+
* CSV file with tenant data
|
|
209
132
|
*/
|
|
210
|
-
|
|
133
|
+
file: Uploadable;
|
|
134
|
+
}
|
|
135
|
+
export interface TenantImportFromWarehouseParams {
|
|
211
136
|
/**
|
|
212
|
-
*
|
|
137
|
+
* Warehouse connection ID to query
|
|
213
138
|
*/
|
|
214
|
-
|
|
139
|
+
connection_id: string;
|
|
215
140
|
/**
|
|
216
|
-
*
|
|
141
|
+
* Database name containing the tenant table
|
|
217
142
|
*/
|
|
218
|
-
|
|
143
|
+
database: string;
|
|
219
144
|
/**
|
|
220
|
-
*
|
|
145
|
+
* Schema name containing the tenant table
|
|
221
146
|
*/
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
export interface TenantUpdateParams {
|
|
147
|
+
schema: string;
|
|
225
148
|
/**
|
|
226
|
-
*
|
|
149
|
+
* Table name containing tenant data
|
|
227
150
|
*/
|
|
228
|
-
|
|
151
|
+
table: string;
|
|
229
152
|
/**
|
|
230
|
-
*
|
|
153
|
+
* Column name for tenant key
|
|
231
154
|
*/
|
|
232
|
-
|
|
155
|
+
tenant_key_column: string;
|
|
233
156
|
/**
|
|
234
|
-
*
|
|
157
|
+
* Column name for tenant group (optional)
|
|
235
158
|
*/
|
|
236
|
-
|
|
159
|
+
tenant_group_column?: string | null;
|
|
237
160
|
/**
|
|
238
|
-
*
|
|
161
|
+
* Column name for tenant display name (optional)
|
|
239
162
|
*/
|
|
240
|
-
|
|
163
|
+
tenant_name_column?: string | null;
|
|
241
164
|
}
|
|
242
165
|
export declare namespace Tenants {
|
|
243
|
-
export { type
|
|
244
|
-
export {
|
|
245
|
-
export { Import as Import, type ImportTenants as ImportTenants, type ImportFromCsvParams as ImportFromCsvParams, type ImportFromWarehouseParams as ImportFromWarehouseParams, };
|
|
246
|
-
export { Groups as Groups, type GroupRetrieveSchemaResponse as GroupRetrieveSchemaResponse };
|
|
166
|
+
export { type ImportTenantsResponse as ImportTenantsResponse, type TenantGetTenantsSchemaResponse as TenantGetTenantsSchemaResponse, type TenantImportFromCsvParams as TenantImportFromCsvParams, type TenantImportFromWarehouseParams as TenantImportFromWarehouseParams, };
|
|
167
|
+
export { Groups as Groups, type GroupGetTenantGroupsSchemaResponse as GroupGetTenantGroupsSchemaResponse };
|
|
247
168
|
}
|
|
248
169
|
//# sourceMappingURL=tenants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,kCAAkC,EAAE,MAAM,EAAE;OAC9C,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;;;;;;OAQG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;IAItF;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAOpC;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CACjB,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;CAGrC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE5C;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;KACpB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACvD;AAED,yBAAiB,8BAA8B,CAAC;IAC9C,UAAiB,MAAM;QACrB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAE9B;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB;CACF;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAID,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,KAAK,kCAAkC,IAAI,kCAAkC,EAAE,CAAC;CAC5G"}
|
|
@@ -4,110 +4,67 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Tenants = void 0;
|
|
5
5
|
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
6
|
const resource_1 = require("../../../core/resource.js");
|
|
7
|
-
const BatchAPI = tslib_1.__importStar(require("./batch.js"));
|
|
8
|
-
const batch_1 = require("./batch.js");
|
|
9
7
|
const GroupsAPI = tslib_1.__importStar(require("./groups.js"));
|
|
10
8
|
const groups_1 = require("./groups.js");
|
|
11
|
-
const
|
|
12
|
-
const import_1 = require("./import.js");
|
|
13
|
-
const headers_1 = require("../../../internal/headers.js");
|
|
14
|
-
const path_1 = require("../../../internal/utils/path.js");
|
|
9
|
+
const uploads_1 = require("../../../internal/uploads.js");
|
|
15
10
|
class Tenants extends resource_1.APIResource {
|
|
16
11
|
constructor() {
|
|
17
12
|
super(...arguments);
|
|
18
|
-
this.batch = new BatchAPI.Batch(this._client);
|
|
19
|
-
this.import = new ImportAPI.Import(this._client);
|
|
20
13
|
this.groups = new GroupsAPI.Groups(this._client);
|
|
21
14
|
}
|
|
22
15
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Validates the client's tenancy type and creates the tenant accordingly:
|
|
26
|
-
*
|
|
27
|
-
* - ROW tenancy: Creates tenant with optional group associations
|
|
28
|
-
* - DATABASE tenancy: Requires database_name, creates tenant with database
|
|
29
|
-
* association
|
|
30
|
-
* - NONE tenancy: Returns error (tenant creation not allowed)
|
|
31
|
-
*
|
|
32
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
33
|
-
*/
|
|
34
|
-
create(body, options) {
|
|
35
|
-
return this._client.post('/api/v1/tenants', { body, ...options });
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get a single tenant by ID.
|
|
16
|
+
* Get all tenants as a TenantSchema object.
|
|
39
17
|
*
|
|
40
|
-
* Returns the
|
|
18
|
+
* Returns tenants in the YAML-compatible schema format with group references.
|
|
19
|
+
* Supports content negotiation: JSON by default, YAML with Accept:
|
|
20
|
+
* application/yaml.
|
|
41
21
|
*
|
|
42
22
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
43
|
-
*
|
|
44
|
-
* Raises: TenantNotFoundError: If tenant doesn't exist (404)
|
|
45
23
|
*/
|
|
46
|
-
|
|
47
|
-
return this._client.get(
|
|
24
|
+
getTenantsSchema(options) {
|
|
25
|
+
return this._client.get('/api/v1/tenants/schema', options);
|
|
48
26
|
}
|
|
49
27
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* Updates tenant metadata, group associations, and/or database associations. Group
|
|
53
|
-
* associations use replace semantics:
|
|
28
|
+
* Import tenants from a CSV file using upsert semantics.
|
|
54
29
|
*
|
|
55
|
-
*
|
|
56
|
-
* - Pass empty list to remove all group associations
|
|
57
|
-
* - Pass list of names to replace all associations
|
|
30
|
+
* Expected CSV format:
|
|
58
31
|
*
|
|
59
|
-
*
|
|
32
|
+
* - tenant_key (required): Unique tenant identifier
|
|
33
|
+
* - tenant_name (optional): Human-readable name
|
|
34
|
+
* - group_names (optional): Comma-separated list of group names
|
|
60
35
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
36
|
+
* Creates new tenants and updates existing ones with new name/groups. Groups are
|
|
37
|
+
* added additively (not replaced) and auto-created if needed.
|
|
63
38
|
*
|
|
64
39
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
65
40
|
*
|
|
66
|
-
* Raises:
|
|
41
|
+
* Raises: ValidationError: If CSV format is invalid (400)
|
|
42
|
+
* TenantCreationNotAllowedError: If tenancy type is NONE (400)
|
|
67
43
|
*/
|
|
68
|
-
|
|
69
|
-
return this._client.
|
|
44
|
+
importFromCsv(body, options) {
|
|
45
|
+
return this._client.post('/api/v1/tenants/import/csv', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
70
46
|
}
|
|
71
47
|
/**
|
|
72
|
-
*
|
|
48
|
+
* Import tenants from a warehouse table using upsert semantics.
|
|
73
49
|
*
|
|
74
|
-
*
|
|
50
|
+
* Creates new tenants and updates existing ones with new name/groups. Groups are
|
|
51
|
+
* added additively (not replaced).
|
|
75
52
|
*
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
list(options) {
|
|
79
|
-
return this._client.get('/api/v1/tenants', options);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Delete a tenant.
|
|
53
|
+
* Streams data from the warehouse in batches to handle large datasets without
|
|
54
|
+
* loading everything into memory.
|
|
83
55
|
*
|
|
84
|
-
*
|
|
56
|
+
* For tenants with groups, groups are aggregated per tenant key and auto-created
|
|
57
|
+
* if they don't exist.
|
|
85
58
|
*
|
|
86
59
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
87
60
|
*
|
|
88
|
-
* Raises:
|
|
89
|
-
|
|
90
|
-
delete(tenantID, options) {
|
|
91
|
-
return this._client.delete((0, path_1.path) `/api/v1/tenants/${tenantID}`, {
|
|
92
|
-
...options,
|
|
93
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get all tenants as a TenantSchema object.
|
|
98
|
-
*
|
|
99
|
-
* Returns tenants in the YAML-compatible schema format with group references.
|
|
100
|
-
* Supports content negotiation: JSON by default, YAML with Accept:
|
|
101
|
-
* application/yaml.
|
|
102
|
-
*
|
|
103
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
61
|
+
* Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
|
|
62
|
+
* TenantCreationNotAllowedError: If tenancy type is NONE (400)
|
|
104
63
|
*/
|
|
105
|
-
|
|
106
|
-
return this._client.
|
|
64
|
+
importFromWarehouse(body, options) {
|
|
65
|
+
return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
|
|
107
66
|
}
|
|
108
67
|
}
|
|
109
68
|
exports.Tenants = Tenants;
|
|
110
|
-
Tenants.Batch = batch_1.Batch;
|
|
111
|
-
Tenants.Import = import_1.Import;
|
|
112
69
|
Tenants.Groups = groups_1.Groups;
|
|
113
70
|
//# sourceMappingURL=tenants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../../src/resources/v1/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,+DAAsC;AACtC,wCAAsE;AAItE,0DAAwE;AAExE,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAiEhE,CAAC;IA/DC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,OAAwB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,4BAA4B,EAC5B,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CACjB,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAlED,0BAkEC;AAoID,OAAO,CAAC,MAAM,GAAG,eAAM,CAAC"}
|
|
@@ -1,108 +1,65 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
-
import * as BatchAPI from "./batch.mjs";
|
|
4
|
-
import { Batch, } from "./batch.mjs";
|
|
5
3
|
import * as GroupsAPI from "./groups.mjs";
|
|
6
4
|
import { Groups } from "./groups.mjs";
|
|
7
|
-
import
|
|
8
|
-
import { Import } from "./import.mjs";
|
|
9
|
-
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
10
|
-
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
+
import { multipartFormRequestOptions } from "../../../internal/uploads.mjs";
|
|
11
6
|
export class Tenants extends APIResource {
|
|
12
7
|
constructor() {
|
|
13
8
|
super(...arguments);
|
|
14
|
-
this.batch = new BatchAPI.Batch(this._client);
|
|
15
|
-
this.import = new ImportAPI.Import(this._client);
|
|
16
9
|
this.groups = new GroupsAPI.Groups(this._client);
|
|
17
10
|
}
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Validates the client's tenancy type and creates the tenant accordingly:
|
|
22
|
-
*
|
|
23
|
-
* - ROW tenancy: Creates tenant with optional group associations
|
|
24
|
-
* - DATABASE tenancy: Requires database_name, creates tenant with database
|
|
25
|
-
* association
|
|
26
|
-
* - NONE tenancy: Returns error (tenant creation not allowed)
|
|
27
|
-
*
|
|
28
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
29
|
-
*/
|
|
30
|
-
create(body, options) {
|
|
31
|
-
return this._client.post('/api/v1/tenants', { body, ...options });
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get a single tenant by ID.
|
|
12
|
+
* Get all tenants as a TenantSchema object.
|
|
35
13
|
*
|
|
36
|
-
* Returns the
|
|
14
|
+
* Returns tenants in the YAML-compatible schema format with group references.
|
|
15
|
+
* Supports content negotiation: JSON by default, YAML with Accept:
|
|
16
|
+
* application/yaml.
|
|
37
17
|
*
|
|
38
18
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
39
|
-
*
|
|
40
|
-
* Raises: TenantNotFoundError: If tenant doesn't exist (404)
|
|
41
19
|
*/
|
|
42
|
-
|
|
43
|
-
return this._client.get(
|
|
20
|
+
getTenantsSchema(options) {
|
|
21
|
+
return this._client.get('/api/v1/tenants/schema', options);
|
|
44
22
|
}
|
|
45
23
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* Updates tenant metadata, group associations, and/or database associations. Group
|
|
49
|
-
* associations use replace semantics:
|
|
24
|
+
* Import tenants from a CSV file using upsert semantics.
|
|
50
25
|
*
|
|
51
|
-
*
|
|
52
|
-
* - Pass empty list to remove all group associations
|
|
53
|
-
* - Pass list of names to replace all associations
|
|
26
|
+
* Expected CSV format:
|
|
54
27
|
*
|
|
55
|
-
*
|
|
28
|
+
* - tenant_key (required): Unique tenant identifier
|
|
29
|
+
* - tenant_name (optional): Human-readable name
|
|
30
|
+
* - group_names (optional): Comma-separated list of group names
|
|
56
31
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
32
|
+
* Creates new tenants and updates existing ones with new name/groups. Groups are
|
|
33
|
+
* added additively (not replaced) and auto-created if needed.
|
|
59
34
|
*
|
|
60
35
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
61
36
|
*
|
|
62
|
-
* Raises:
|
|
37
|
+
* Raises: ValidationError: If CSV format is invalid (400)
|
|
38
|
+
* TenantCreationNotAllowedError: If tenancy type is NONE (400)
|
|
63
39
|
*/
|
|
64
|
-
|
|
65
|
-
return this._client.
|
|
40
|
+
importFromCsv(body, options) {
|
|
41
|
+
return this._client.post('/api/v1/tenants/import/csv', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
66
42
|
}
|
|
67
43
|
/**
|
|
68
|
-
*
|
|
44
|
+
* Import tenants from a warehouse table using upsert semantics.
|
|
69
45
|
*
|
|
70
|
-
*
|
|
46
|
+
* Creates new tenants and updates existing ones with new name/groups. Groups are
|
|
47
|
+
* added additively (not replaced).
|
|
71
48
|
*
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
list(options) {
|
|
75
|
-
return this._client.get('/api/v1/tenants', options);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Delete a tenant.
|
|
49
|
+
* Streams data from the warehouse in batches to handle large datasets without
|
|
50
|
+
* loading everything into memory.
|
|
79
51
|
*
|
|
80
|
-
*
|
|
52
|
+
* For tenants with groups, groups are aggregated per tenant key and auto-created
|
|
53
|
+
* if they don't exist.
|
|
81
54
|
*
|
|
82
55
|
* RLS: Filtered to current client (ClientRLSDB).
|
|
83
56
|
*
|
|
84
|
-
* Raises:
|
|
85
|
-
|
|
86
|
-
delete(tenantID, options) {
|
|
87
|
-
return this._client.delete(path `/api/v1/tenants/${tenantID}`, {
|
|
88
|
-
...options,
|
|
89
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get all tenants as a TenantSchema object.
|
|
94
|
-
*
|
|
95
|
-
* Returns tenants in the YAML-compatible schema format with group references.
|
|
96
|
-
* Supports content negotiation: JSON by default, YAML with Accept:
|
|
97
|
-
* application/yaml.
|
|
98
|
-
*
|
|
99
|
-
* RLS: Filtered to current client (ClientRLSDB).
|
|
57
|
+
* Raises: ConnectionNotFoundError: If the connection doesn't exist (404)
|
|
58
|
+
* TenantCreationNotAllowedError: If tenancy type is NONE (400)
|
|
100
59
|
*/
|
|
101
|
-
|
|
102
|
-
return this._client.
|
|
60
|
+
importFromWarehouse(body, options) {
|
|
61
|
+
return this._client.post('/api/v1/tenants/import/warehouse', { body, ...options });
|
|
103
62
|
}
|
|
104
63
|
}
|
|
105
|
-
Tenants.Batch = Batch;
|
|
106
|
-
Tenants.Import = Import;
|
|
107
64
|
Tenants.Groups = Groups;
|
|
108
65
|
//# sourceMappingURL=tenants.mjs.map
|